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. But..

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

- Build iOS platform: $ ionic build ios --prod

- Open Project with XCode (follow ionicframework.com instructions, 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 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

  1. duplicate symbol _OBJC_IVAR_$_IonicKeyboard._keyboardShowObserver in:
  2. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
  3. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
  4. duplicate symbol _OBJC_IVAR_$_IonicKeyboard._keyboardHideObserver in:
  5. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
  6. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
  7. duplicate symbol _OBJC_IVAR_$_IonicKeyboard._hideKeyboardAccessoryBar in:
  8. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
  9. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
  10. duplicate symbol _OBJC_IVAR_$_IonicKeyboard._disableScroll in:
  11. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
  12. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
  13. duplicate symbol _OBJC_CLASS_$_IonicKeyboard in:
  14. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
  15. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
  16. duplicate symbol _OBJC_METACLASS_$_IonicKeyboard in:
  17. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-B2AFBA783A31ACC2.o
  18. /Users/Angel/Documents/Molanco/Vigilero/vigiapp-mobile-master/platforms/ios/build/Vigilero.build/Debug-iphonesimulator/Vigilero.build/Objects-normal/i386/IonicKeyboard-FBF9F94FE5C04A85.o
  19. 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: 

  1. $ cordova plugin list
  2. 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:

  1. "_OBJC_CLASS_$_SKStoreProductViewController", referenced from:
  2. 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

Meta description : 
ionic