I would like to build a native iOS module that requires a CocoaPods pod (https://cocoapods.org/pods/NearbyMessages).
I created a new module using the Titanium Command Line Interface:
ti create --type=module --platforms=ios ...
I followed the instructions from CocoaPods (https://guides.cocoapods.org/using/using-cocoapods.html) to create a Podfile:
platform :ios, '9.0'
target 'MyModule' do
pod 'NearbyMessages'
end
I placed the Podfile into the "iphone" directory of my iOS module directory:
MyModule
- LICENCE
- README
- assets
- documentation
- example
- iphone
- Podfile
- ...
- timodule.xml
- titanium.xcconfig
I installed the pod using the following command:
pod install
I opened XCode with the newly created *.xcworkspace file and added the following line to the end of the titanium.xcconfig file:
#include "Pods/Target Support Files/Pods-MyModule/Pods-MyModule.debug.xcconfig"
But unfortunately this leads to several errors, like:
I tried different variations of including the Pods config file but none of them were successful.
Can anybody please tell me how a correct XCode setup should look like to use the NearbyMessages pod in a native iOS module?
Thanks in advance and best regards!
The build.py file needs to be updated to use the workspace file instead. Inside the build_module method, add the -workspace and -scheme parameters to xcodebuild. The lines should look like this:
rc = os.system("xcodebuild -workspace %s.xcworkspace -scheme %s -sdk iphoneos -configuration Release" %(manifest['name'],manifest['name']))
rc = os.system("xcodebuild -workspace %s.xcworkspace -scheme %s -sdk iphonesimulator -configuration Release" %(manifest['name'],manifest['name']))
After making this change, python build.py
should work successfully.
I'm just at the point of figuring this out for myself, so there may need to be more steps, but that got me past the point you are at.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With