Home / Blog / Ionic: Deploying iOS App
Angel's picture
Angel Alvarado R.
Soft. and Data engineer.
23 Jan 2017
Ionic:
Deploying iOS App

Deploying an Ionic iOS App is suppose to be easy. However, there are always gotchas.

Body: 

Deploying an iOS APP in Ionic is suppose to be easy. However, there are always some gotchas.

The basics: 

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

duplicate symbol _OBJC_IVAR_$_IonicKeyboard._keyboardShowObserver in:
    /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
    /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
duplicate symbol _OBJC_IVAR_$_IonicKeyboard._keyboardHideObserver in:
    /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
    /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
duplicate symbol _OBJC_IVAR_$_IonicKeyboard._hideKeyboardAccessoryBar in:
    platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
    platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
duplicate symbol _OBJC_IVAR_$_IonicKeyboard._disableScroll in:
    platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
    platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
duplicate symbol _OBJC_CLASS_$_IonicKeyboard in:
    /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
    platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
duplicate symbol _OBJC_METACLASS_$_IonicKeyboard in:
    platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
    platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
ld: 6 duplicate symbols for architecture i386

 

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: $ ./platforms/ios/cordova/clean

- 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:

"_OBJC_CLASS_$_SKStoreProductViewController", referenced from:
      objc-class-ref in CDVAppRate.o**

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

Useful links

Stop downloading OSx App: https://discussions.apple.com/thread/3992166?start=0&tstart=0

http://stackoverflow.com/a/39674981/4705437

http://stackoverflow.com/questions/22423495/admob-ios-x64-error