[AC-1362] iOS: Adding a framework to a module, linker error and relative path confusion
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-07-04T00:20:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Appcelerator Modules |
Labels | TCSupportTriage, framework, iOS, module |
Reporter | Adam |
Assignee | Radamantis Torres-Lechuga |
Created | 2014-11-08T16:21:15.000+0000 |
Updated | 2016-03-08T07:37:46.000+0000 |
Description
There is quite a bit of confusion on how exactly to include a 3rd party framework into an iOS module for Titanium Mobile.
Most are able to put together the fact that you need to adjust the module.xcconfig to include the framework and the path to the framework. However, the path to the framework is a point of contention.
For example, consider the following module.xcconfig definition:
OTHER_LDFLAGS=$(inherited) -ObjC -framework AddressBook -framework AssetsLibrary -framework Foundation -framework CoreLocation
-framework CoreMotion -framework CoreGraphics -framework CoreText -framework MediaPlayer
-framework Security -framework SystemConfiguration -framework UiKit
-F"./libs/google-plus-ios-sdk-1.7.1/" -framework GooglePlus
-framework GoogleOpenSource
(Note that I added line breaks above for readability)
This assumes that the google plus framework source is located under a folder called libs which is placed at the root of the module's folder structure.
This builds correctly. However, the built zip file does not include the necessary framework files within the compiled module. Therefore, when the zipped module is shared to other developers, the necessary frameworks are missing and those developer's applications will fail on build.
Furthermore, even if the files were included in the zip, the build would most likely fail since the path would be wrong relative to the other developer's application source. i.e. If given to a 3rd party developer, the path would most likely need to be specified as something like:
./modules/iphone/MODULE_NAME/MODULE_VERSION/libs/google-plus-ios-sdk-1.7.1/
... to get the 3rd party developer's application to build correctly and include the proper framework source.
What exactly is the correct way to include 3rd party framework sources in an iphone module such that paths can be relative and all necessary files will be included in the module's build zip file?
We updated Module development docs, and it's addressing this