7

Cordova v5.3.1 / Ionic v1.1.0 (library v1.6.4)

Upgraded our application to iOS 9 from 8.4. The application builds and runs fine on 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] *** Assertion failure 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] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'accessing _cachedSystemAnimationFence requires the main thread'

The debug console is identical up to this point.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Joey
  • 477
  • 5
  • 10

2 Answers2

6

I don't know the real reason but when the App has WebView and third party keyboard such as Swype, program crashes. I replicated the issue many times. So if your app uses WebView such as Cordova, iAd, Admob you will see these weird crashes. I don't know how to prevent this issue. It only happens on iOS and only on iPhones. My crash reports show iPhone 5s, iPhone 6, iPhone 6 Plus.

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

func application(application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: String) -> Bool {

    if extensionPointIdentifier == UIApplicationKeyboardExtensionPointIdentifier {
        return false
    }

    return true

}
Meanteacher
  • 2,031
  • 3
  • 17
  • 48
  • In our case, we aren't using any 3rd party keyboards. – Joey Oct 08 '15 at 22:50
  • @Joey You mention you weren't using any 3rd party keyboards, but still accepted the answer. Did this help regardless of the keyboard situation? – jmknoll Jan 23 '16 at 11:38
5

This seems to be a conflict between 3rd party keyboards and the WebView. I am also able to crash Chrome (outside of Cordova) on iOS 9. I just go to a popular website and focus on some edit fields a few times. You can do his while the page is loading to bring out the keyboard while a certain custom one is enabled and it crashes.

I created a simple Cordova plugin to not allow any keyboard extensions to run with the app. Not a permanent solution, but it will stop the crashes for now. Just add the plugin, no code changes are needed.

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

Kurt.F
  • 61
  • 2