iOS 9 and Ionic Build Errors

Why?

I ran into a lot of gotchas trying to publish my recent Ionic app to the App Store. It was bad timing because iOS 9 was just released and Apple is in the process of updating all the dev tools which means breaking changes for all of us. So here are a few of the majors warnings/errors I ran into. Hope they help :)

New iPad Settings Error

If you're trying to upload your app to the App Store from Xcode you might be getting the above error. This is a new setting for iPad Pro that lets the device know how your app should behave with iPad's split-view/multitasking feature.

If you go into the "General" menu for your app in Xcode under "Deployment Info" you will find an iPad tab click on this and check all the "Device Orientation" check boxes. Then select the "Requires full screen" checkbox under "Status Bar Style". This tells the new iPad to run your app in fullscreen only and not allow the new splitview functionality. This will get rid of the invalid bundle error you received.

Breaking Change in Angular Navigation Stack

There is a breaking change with Angular and iOS 9 that involves navigation and you may be getting a console error as you nav around in your app. The Ionic team has released a pretty simple patch for this that works well for the time being.

To apply the patch you just need to copy this Custom Controller and inject it into your app dependencies.

App Transport Security Policy Error

Failed to load resource: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

Apple is tightening up security in iOS 9 and they are discouraging unsecure connections. Which is good, but if you're like me you may have an app the requires unsecure connections to function. You can get around this restriction by adding the line below to your app's AppName-info.plist under "platforms/ios/AppName/"

Pro Tips

If your app isn't launching or is behaving strangely on a real device or the simulator it could be because of Xcode's debugger called "lldb" if you run killall lldb when your app is behaving strangely it will restart the service and should start building and running more smoothly.

The lldb tool has been around for a while so you can try this technique on older versions of Xcode as well. It does seem to be more of a problem on the latest version, so hopefully they will get it running smoother in the future.