This is a migrated thread and some comments may be shown as answers.

create cordova plugin using libxml2

3 Answers 73 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Maor
Top achievements
Rank 1
Maor asked on 09 Apr 2014, 06:45 AM
hi guys.
i am not sure if this post related to this thread. 
i am trying to create cordova plugin which use xmpp protocol in ios.
to android i created one and it works just fine (still need some tuning but at least work).
in objective-c its a lot of different struggle. i use robbie hanson xmppFramework( https://github.com/robbiehanson/XMPPFramework) and manage to create a static library that i can use from the plugin. the problem start with the dependency in libxml2 and other dynamic libraries. following cordova plugin specs ( http://docs.phonegap.com/en/3.4.0/plugin_ref_spec.md.html#Plugin%20Specification) i managed to create plugin which import the framework i have create and also the dynamic libraries that should be include. but the problem is that libxml2 need a special XCODE config set: seting header search paths to "/usr/include/libxml2".
as a user of AppBuilder i does not have any access to xcode( i have but i prefer using appbuuilder) to set this header path so basically i am asking if there is option to set headers search paths from plugin.xml file or maybe an compiler flag which can set this option on target?
thanks for reading and helping.
best regards .
maor

3 Answers, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 11 Apr 2014, 03:52 PM
Hi Maor,

Plugins development is not in the scope of our support service, but if you open a private ticket and send your plugin we could take a look at it.

Is there an error that requires such header or it is your plugin's requirement?
Some details would be helpful.
Thanks.

Regards,
Zdravko
Telerik
 

Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

 
0
Maor
Top achievements
Rank 1
answered on 13 Apr 2014, 07:01 AM
hi Zdravko. thanks for your reply.
xmppFramework for ios depends on the libxml2 which is dynamic lib in ios. also to include it in a project or plugin you need to configure XCODE header search path to look in the "/usr/include/libxml2" and add to other linker flags this flag:"-lxml2". after do so the framework will compile correctly. if i try to compile the plugin in the project without using this requirement it will throw "lexical parse error" on files that try to import headers from "libxml/tree.h".
hope this info help you to get the big picture. 
btw, another thing i came accross with is what if i want to include ".xcdatamodeld" file? it throws me 
"path/where/xcdatamodeld/requiredfile.xcdatamodeld is a directory (not copied)". so is there other way to do so?

regards maor.
0
Zdravko
Telerik team
answered on 16 Apr 2014, 03:55 PM
Hello Maor,

We think that if you add the following line of code to your plugin.xml file in the iOS part should do the trick:
<source-file src="libxml2.dylib" framework="true" /> so it should look like:

<!-- ios -->
<platform name="ios">
<source-file src="libxml2.dylib" framework="true" />
.....

According to this thread this indeed is a directory and I am not sure it is supported. Following this post you can compile it and then try to include it in your plugin.
Thanks.

Regards,
Zdravko
Telerik
 

Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

 
Tags
Apache Cordova
Asked by
Maor
Top achievements
Rank 1
Answers by
Zdravko
Telerik team
Maor
Top achievements
Rank 1
Share this question
or