Modules that have frameworks built using Swift do not work. Modules compile, but when you try to build an app using the module, you get errors:
As you can see from the error, we attempted to implement the Chase Paymentech SDK. Chase puts the Paymentech SDK download behind a login wall... We can't provide it, but you can sign up (free) and download it.
So, to reproduce this error (and possibly fix it), my steps:
- ti create -n ti.test -p ios --id ti.test -t module -url "http://test.com" -d .
- Open up the project in Xocde. Confirm it builds.
- Download the library from https://secure.paymentech.com/developercenter/mobilesdk/ios/?WT.mc_id=adc001_sdk
- Place the .framework file in <module_root>/iphone/platform
- Drag the file into the source explorer in Xcode. No need to copy it (as it's already in the project). Or you can follow the linking instructions in the paymenttech docs
- Edit the module.xcconfig file to reference the framework:
The module builds without error for me (both from inside Xcode and from the command line).
- Drop the built module into the global module cache (Unzipped). For me this is ~/Library/ApplicationSupport/Titanium/modules/iphone
- Open Studio
- Create a new 2-tabbed app, iPhone/iPad only
- Add the module to the application from the tiapp.xml editor
- Drop to the command line. 'ti build -p iOS'.
The app will fail to build, unable to find the ChasePaymentech framework
- Open builds/iphone/<AppName>.xcodeproj
- Follow the instructions in the Paymenttech document to both link the framework in the application, and then to copy the framework during the build process.
- Place the framework library in a folder accessible to your application.
- Select Project Setting and Build Phase. Click on “Link Binary With Libraries” section. Then press “+” button to add the framework.
- Click on “Add Other…” and choose ChasePaymentech.framework from the physical location in step 1.
- Click “Copy Files”, ensure “Framework” is selected in “Description” drop-down. Click “+” as indicated below.
- Select “ChasePaymentech.framework” under “frameworks”.
- Under “Project Navigator”, within “Frameworks”, “ChasePaymentech.framework” would have been added.
Attempt to build the application, you will get the error about "ld: embedded dylibs/frameworks are only supported on iOS 8.0 and later"
Build Settings > iOS Deployment Target. Update this to 8.0
App builds successfully...sometimes. When it fails, it appears to fail because it can't find the Chase framework. This suggests that the framework isn't being copied in time to the correct output location before linking.