ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: crash on ios9 when input focus

Open CandySunPlus opened this issue 11 years ago • 16 comments

Type: bug

Platform: ios 9 webview

just crash in ios9

2015-09-22 00:39:08.256 missfresh[1696:920538] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
 Stack:(
    0   CoreFoundation                      0x0000000182fc0f74 <redacted> + 148
    1   libobjc.A.dylib                     0x0000000197bb3f80 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000182fc0ea4 <redacted> + 0
    3   Foundation                          0x0000000183fda5d8 <redacted> + 88
    4   Foundation                          0x0000000183e5ca1c <redacted> + 36
    5   UIKit                               0x000000018861b958 <redacted> + 64
    6   UIKit                               0x000000018861c470 <redacted> + 244
    7   UIKit                               0x0000000188638f44 <redacted> + 108
    8   UIKit                               0x0000000188d42798 <redacted> + 268
    9   UIKit                               0x0000000188819fcc <redacted> + 176
    10  UIKit                               0x00000001888090b4 <redacted> + 52
    11  UIKit                               0x000000018851300c <redacted> + 644
    12  QuartzCore                          0x0000000187d19f14 <redacted> + 148
    13  QuartzCore                          0x0000000187d14b20 <redacted> + 292
    14  QuartzCore                          0x0000000187d149e0 <redacted> + 32
    15  QuartzCore                          0x0000000187d1407c <redacted> + 252
    16  QuartzCore                          0x0000000187d13dd0 <redacted> + 516
    17  QuartzCore                          0x0000000187d0d4bc <redacted> + 80
    18  CoreFoundation                      0x0000000182f77c30 <redacted> + 32
    19  CoreFoundation                      0x0000000182f759d4 <redacted> + 372
    20  CoreFoundation                      0x0000000182f75e04 <redacted> + 928
    21  CoreFoundation                      0x0000000182ea4dc0 CFRunLoopRunSpecific + 384
    22  WebCore                             0x0000000194b09aa0 <redacted> + 456
    23  libsystem_pthread.dylib             0x00000001985c3b3c <redacted> + 156
    24  libsystem_pthread.dylib             0x00000001985c3aa0 <redacted> + 0
    25  libsystem_pthread.dylib             0x00000001985c1030 thread_start + 4
)
2015-09-22 00:39:08.260 missfresh[1696:920538] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
 Stack:(
    0   CoreFoundation                      0x0000000182fc0f74 <redacted> + 148
    1   libobjc.A.dylib                     0x0000000197bb3f80 objc_exception_throw + 56
    2   CoreFoundation                      0x0000000182fc0ea4 <redacted> + 0
    3   Foundation                          0x0000000183fda5d8 <redacted> + 88
    4   Foundation                          0x0000000183e60f3c <redacted> + 56
    5   Foundation                          0x0000000183e5cafc <redacted> + 260
    6   UIKit                               0x000000018861b958 <redacted> + 64
    7   UIKit                               0x000000018861c470 <redacted> + 244
    8   UIKit                               0x0000000188638f44 <redacted> + 108
    9   UIKit                               0x0000000188d42798 <redacted> + 268
    10  UIKit                               0x0000000188819fcc <redacted> + 176
    11  UIKit                               0x00000001888090b4 <redacted> + 52
    12  UIKit                               0x000000018851300c <redacted> + 644
    13  QuartzCore                          0x0000000187d19f14 <redacted> + 148
    14  QuartzCore                          0x0000000187d14b20 <redacted> + 292
    15  QuartzCore                          0x0000000187d149e0 <redacted> + 32
    16  QuartzCore                          0x0000000187d1407c <redacted> + 252
    17  QuartzCore                          0x0000000187d13dd0 <redacted> + 516
    18  QuartzCore                          0x0000000187d0d4bc <redacted> + 80
    19  CoreFoundation                      0x0000000182f77c30 <redacted> + 32
    20  CoreFoundation                      0x0000000182f759d4 <redacted> + 372
    21  CoreFoundation                      0x0000000182f75e04 <redacted> + 928
    22  CoreFoundation                      0x0000000182ea4dc0 CFRunLoopRunSpecific + 384
    23  WebCore                             0x0000000194b09aa0 <redacted> + 456
    24  libsystem_pthread.dylib             0x00000001985c3b3c <redacted> + 156
    25  libsystem_pthread.dylib             0x00000001985c3aa0 <redacted> + 0
    26  libsystem_pthread.dylib             0x00000001985c1030 thread_start + 4
)
2015-09-22 00:39:08.262 missfresh[1696:920538] *** Assertion failure in -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3505.16/UIApplication.m:1697
2015-09-22 00:39:08.305 missfresh[1696:920538] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'accessing _cachedSystemAnimationFence requires the main thread'
*** First throw call stack:
(0x182fc0f5c 0x197bb3f80 0x182fc0e2c 0x183eaff3c 0x1887b30e8 0x1887b31ac 0x1888053cc 0x188cb37a4 0x188cae158 0x188815fc8 0x1885736b4 0x18861ea40 0x18852e6b8 0x182eb7ab0 0x182eb79a8 0x18851d3e8 0x18861eb88 0x18881a210 0x18851300c 0x187d19f14 0x187d14b20 0x187d149e0 0x187d1407c 0x187d13dd0 0x187d0d4bc 0x182f77c30 0x182f759d4 0x182f75e04 0x182ea4dc0 0x194b09aa0 0x1985c3b3c 0x1985c3aa0 0x1985c1030)
libc++abi.dylib: terminating with uncaught exception of type NSException
libsystem_kernel.dylib`__pthread_kill:
    0x1984fb1d8 <+0>:  movz   x16, #0x148
    0x1984fb1dc <+4>:  svc    #0x80
->  0x1984fb1e0 <+8>:  b.lo   0x1984fb1f8               ; <+32>
    0x1984fb1e4 <+12>: stp    x29, x30, [sp, #-16]!
    0x1984fb1e8 <+16>: mov    x29, sp
    0x1984fb1ec <+20>: bl     0x1984e2330               ; cerror_nocancel
    0x1984fb1f0 <+24>: mov    sp, x29
    0x1984fb1f4 <+28>: ldp    x29, x30, [sp], #16
    0x1984fb1f8 <+32>: ret    
```</span>

<span is-issue-template></span>

CandySunPlus avatar Sep 21 '15 16:09 CandySunPlus

I have the same problem.

huip avatar Sep 22 '15 06:09 huip

I have the same problem, too.

ramsaylee avatar Oct 02 '15 14:10 ramsaylee

+1

john-zwiep-hs avatar Oct 02 '15 21:10 john-zwiep-hs

+1

We're seeing this with the InAppBrowser plugin. The plugin is making UI changes within the main WebView thread and the new iOS SDK throws an exception now (instead a warning). Tried wrapping the open method of the plugin in a dispatch_async(...) block but it did not work:

http://stackoverflow.com/questions/28302019/getting-a-this-application-is-modifying-the-autolayout-engine-error

Also, wrapping the method in [self.commandDelegate runInBackground:^{ ... }] did not work:

https://cordova.apache.org/docs/en/2.5.0/guide_plugin-development_ios_index.md.html

ghost avatar Oct 02 '15 23:10 ghost

+1 Any idea how to fix it?

maciejwitalinski avatar Oct 05 '15 11:10 maciejwitalinski

Have not seen this before, though this might not be the best place to open an issue for it. It sounds like this is a cordova specific issue. Please follow up with the cordova folks and open an issue here.

https://issues.apache.org/jira/browse/CB-9746?jql=project%20%3D%20CB

Closing this for now, if someone could open an issue on their issue tracker with any relevant information, we can follow it up over there.

mhartington avatar Oct 05 '15 12:10 mhartington

I've opened up the following thread after no finding any others referencing autolayout: https://issues.apache.org/jira/browse/CB-9769

ryanengland avatar Oct 08 '15 18:10 ryanengland

It is a show stopper for me :(

2015-10-08 20:31 GMT+02:00 Ryan England [email protected]:

I've opened up the following thread after no finding any others referencing autolayout: https://issues.apache.org/jira/browse/CB-9769

— Reply to this email directly or view it on GitHub https://github.com/driftyco/ionic/issues/4402#issuecomment-146646623.

maciejwitalinski avatar Oct 09 '15 09:10 maciejwitalinski

There appears to be a problem with the Swype keyboard extension on iOS 9 causing crashes. I've even been able to get Chrome (outside of Cordova) to crash using this keyboard on iOS 9. I've created a very simple Cordova plugin to prevent third party keyboards from running in the app. This will at least keep the app from crashing.

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

kurtisf avatar Oct 12 '15 20:10 kurtisf

Also, if you install the Swype keyboard, and hook up an iPhone to the debugger, when the app crashes, every single time, the keyboard has slid out just to the space bar. It seems at that point there is some code that runs on a background causing the crash.

kurtisf avatar Oct 12 '15 21:10 kurtisf

@kurtisf nice, thanks for the plugin. I wonder if it would be possible to integrate that code into the keyboard plugin?

mhartington avatar Oct 12 '15 21:10 mhartington

@mhartington It should be easy enough. I'll need to change the code from being in a category to a swizzle to be more correct. I'll see if I can make a pull request to the keyboard plugin in the next day or two.

kurtisf avatar Oct 13 '15 21:10 kurtisf

+1 for this. Not sure if exactly the same issue but I've had users saying that they're using Swype with ios9 and the app just crashes. They had to revert to the normal keyboard to be able to open the app.

goodthing avatar Oct 14 '15 23:10 goodthing

Thanks for the info - have got our client to remove Swype keyboard and not experiencing this error anymore. Great!

On 15 Oct 2015, at 00:24, streetkid [email protected] wrote:

+1 for this. Not sure if exactly the same issue but I've had users saying that they're using Swype with ios9 and the app just crashes. They had to revert to the normal keyboard to be able to open the app.

— Reply to this email directly or view it on GitHub.

ryanengland avatar Oct 15 '15 07:10 ryanengland

@mhartington I made a pull request for the keyboard plugin: https://github.com/driftyco/ionic-plugin-keyboard/pull/145

kurtisf avatar Oct 16 '15 16:10 kurtisf

@kurtisf +1 - https://github.com/kurtisf/cordova-plugin-restrict-keyboard Works 100% for me

ettiennelouw avatar Nov 25 '15 17:11 ettiennelouw