Working with iOS frameworks

44 views
Skip to first unread message

nickk...@gmail.com

unread,
Jun 16, 2014, 5:21:34 AM6/16/14
to codenameone...@googlegroups.com
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans
Desktop OS: Windows 7
Device: iOS

I'm trying include native code in my Android and iOS app.  I've done this plenty of times before but only with source files (either my own, or third party).  In this case I have native libraries in .jar and .framework forms respectively.

I got the jar working on Android fairly easily, just put it in the native/android folder and import it with its own package name and it worked.

For iOS seems like I should be able to do the same thing with the .framework.  But its not being found.  I'm importing in my .m file with angle brackets, not quote marks and trying to access a .h file in the framework:

e.g.,

#import <MyFramework/MyFramework.h>

I get build errors that say that the .h file wasn't found.

because I'm using Windows the .framework is a folder, not a 'package' the way it appears on a Mac, could that be part of the problem?  Or do I import a different way, or do I put the framework file in a different place?  Or do I need to inject anything into the plist file?

Any hints, all I can find from searching seems to be put it in the native/ios folder and it'll work, but its not, so I think I'm doing something wrong here.

Cheers,
Nick



Shai Almog

unread,
Jun 16, 2014, 12:14:03 PM6/16/14
to codenameone...@googlegroups.com, nickk...@gmail.com
Due to XMLVM's constraints iOS doesn't support hierarchies and directories in the native package. Everything must be flat in its place so you need to include the headers in the root and the lib file there too.
A framework has a lib file under the current directory, just rename itto libFrameworkName.a and place it together with the relative headers and import from the current directory e.g: #import "MyFramework.h"

nickk...@gmail.com

unread,
Jan 5, 2015, 4:17:29 PM1/5/15
to codenameone...@googlegroups.com, nickk...@gmail.com
Sorry to open an old thread, but is this still the way to do it for the newVM?  I need to include a thirdparty .framework.  I tried optimistically dropping it in but that didn't build (couldn't find the header imported within the framework), I also tried this process, getting the lib out, renaming it and putting all the headers into a flat hierarchy.  It compiled but it wouldn't link with the renamed .a file and therefore didn't finish building.

Shai Almog

unread,
Jan 6, 2015, 1:29:50 AM1/6/15
to codenameone...@googlegroups.com, nickk...@gmail.com
Yes, this should work just fine. See the native GoogleMaps which essentially uses a static library and works with the new VM.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages