Deploying an Ionic iOS App is suppose to be easy. However, there are always gotchas.
Deploying an iOS APP in Ionic is suppose to be easy. However, there are always some gotchas.
These are the general steps to deploy the an Ionic App:
- Clone your Ionic App:
$ git clone github.com...
- Install dependencies:
$ npm install
- Add iOS platform:
$ cordova platform add ios
- Build iOS platform:
$ ionic build ios --prod
- Open Project with XCode (follow the instructions on ionicframework.com, you need an Apple ID)
- Connect your phone via USB and select it as the run target (Product-> Destination -> Device)
- Signing your App
- Click the play button in Xcode IDE to try to run your app
Below you'll find errors found while following the above steps and the ionic's framework instructions
Errors when building iOS
- duplicate symbol _OBJC_IVAR_$_IonicKeyboard
The error is telling us that somehow _OBJC_IVAR_$_IonicKeyboard._keyboardShowObserver is being declared multiple times.
- One thing is for sure
iconic-plugin-keyboard is used in config.xml:
- Where else is it being instantiated/used? Turned out Cordova is using an old version of this library:
$ cordova plugin list
com.ionic.keyboard 1.0.4 "Keyboard"
- Delete it:
$ cordova plugin remove com.ionic.keyboard
- Clean just in case:
- Build again:
$ ionic build ios --prod -> ** BUILD SUCCEEDED *
Deploying App: Error Model is running iOS 10.2 (14C92), which may not be supported by this version of Xcode
This one was tricky because the error keep showing even after updating the xCode IDE
I followed these steps to solve it: http://stackoverflow.com/a/41928402/4705437. Not sure if this is actually safe but I'll dig more details later on.
Deploying App: Xcode couldn't find a provisioning profile matching & 'In-App Purchase' errors
I do not want App purchase at this time, easy to solve by a little bit of Stackoverflowing:
"Remove the StoreKit.framework, go to Signing, disable the 'Automatically manage signing' option and enable it again. If needed, set your Team to 'None' and set it back to your Personal Development Team, which should trigger the automatic provisioning mechanism."
If you find this error:
Make sure to add back Storekit.framework
Deploying App: Verify the developer App certificate for your account...
This is easy to solve by following the instructions:
Facebook Native authentication
If you are having issues authenticating an Ionic iOS App make sure to follow these instructions: https://docs.ionic.io/services/auth/facebook-native.html
Stop downloading OSx App: https://discussions.apple.com/thread/3992166?start=0&tstart=0