IOS 9 Ionic Cordova App Crashes on iPhone; works on iPad

Cordoba v5.3.1 / Ionic v1.1.0 (Library v1.6.4)

Upgraded our application on iOS 9 from 8.4. The app builds and works great on the iPad / iPad mini. However, it crashes when deployed to an iPhone.

Below is the debug output:

2015-09-23 11:17: 09.920 AnApplicaiton [6490: 1359695] *** Denial approval in [UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:], / BuildRoot / Library / Caches / com.apple.xbs / Sources / UIKit_Sim / UIKit-3505.16 / UIApplication .m: 1697

2015-09-23 11:17: 09.926 AnApplication [6490: 1359695] *** The application terminated due to the unannounced exception "NSInternalInconsistencyException", reason: "access to _cachedSystemAnimationFence requires the main thread

The debug console is identical to this point.

+7
ios ios9 ionic-framework iphone-6
source share
2 answers

I don’t know the real reason, but when the application has a WebView and a third-party keyboard, such as Swype, the program crashes. I have repeatedly repeated this problem. Therefore, if your application uses a WebView such as Cordova, iAd, Admob, you will see these strange crashes. I do not know how to prevent this problem. This only happens on iOS and iPhone only. My crash reports display iPhone 5, iPhone 6, iPhone 6 Plus.

Edit: I think the code given by @ Kurt.F can solve the problem for now. Add the following code to your AppDelegate.swift file. All loans go to @ Kurt.F

 func application(application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: String) -> Bool { if extensionPointIdentifier == UIApplicationKeyboardExtensionPointIdentifier { return false } return true } 
+6
source share

This is like a conflict between third-party keyboards and WebView. I can also destroy Chrome (outside Cordoba) on iOS 9. I just go to the popular website and edit the fields several times. You can do it while the page is loading to bring out the keyboard when a certain custom one is turned on and it will work.

I created a simple Cordova plugin to prevent any keyboard extensions from running through the application. This is not a permanent solution, but at the moment it will stop the accident. Just add the plugin, no code changes are required.

https://github.com/kurtisf/cordova-plugin-restrict-keyboard

+5
source share

All Articles