Repository navigation
Add test for fix of "Crash on device during rotation" #31139
Description
Steps to Reproduce
I am using flutter in an add to existing native app. On screen rotation I am getting a crash with the stack trace below. Runs perfectly fine in both emulator or device (no rotation) otherwise.
- It does not crash on an emulator, only on a physical device.
- It does not crash on flutter channel stable, but anything newer then that and it does crash, I pasted my flutter doctor output for both working and crashing channels below.
- My device for testing that it is crashing on is a Pixel 1 XL on Android 9, April security update. Attempting to find other devices to try on as well, will update if needed.
Logs
E/flutter: [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(40)] java.lang.IllegalArgumentException: array == null
at android.opengl.Matrix.multiplyMM(Native Method)
at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2018)
at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
at io.flutter.view.AccessibilityBridge$SemanticsNode.access$4100(AccessibilityBridge.java:1680)
at io.flutter.view.AccessibilityBridge.updateSemantics(AccessibilityBridge.java:1237)
at io.flutter.view.AccessibilityBridge$1.updateSemantics(AccessibilityBridge.java:268)
at io.flutter.embedding.engine.FlutterJNI.updateSemantics(FlutterJNI.java:150)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:160)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
A/flutter: [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(96)] Check failed: CheckException(env).
A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 19533 (io.clientcenter), pid 19533
This version works, no crash on device.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.4 18E226, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
[✓] Android Studio (version 3.4)
[✓] Android Studio (version 3.3)
[✓] Android Studio
[✓] VS Code (version 1.33.1)
[✓] Connected device (1 available)
Crashes on this channel and newer.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.4.9-hotfix.1, on Mac OS X 10.14.4 18E226, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
[✓] Android Studio (version 3.4)
[✓] Android Studio (version 3.3)
[✓] Android Studio
[✓] VS Code (version 1.33.1)
[✓] Connected device (1 available)
• No issues found!
Activity
huuang commentedon Apr 19, 2019
I am facing the same problem in a xiaomi brand phone while other phones work well.
flutter doctor -v
[✓] Flutter (Channel dev, v1.4.10, on Mac OS X 10.14.4 18E226, locale en-CN)
• Flutter version 1.4.10 at /Users/huangjihua/Development/flutter
• Framework revision 6ba720a (2 weeks ago), 2019-04-04 11:27:41 -0400
• Engine revision 5944867
• Dart version 2.2.1 (build 2.2.1-dev.3.0 None)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/huangjihua/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2, Build version 10E125
• ios-deploy 2.0.0
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 33.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] VS Code (version 1.33.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.25.1
[✓] Connected device (1 available)
• MI 5X • 01574a839805 • android-arm64 • Android 7.1.2 (API 25)
• No issues found!
Error log:
[ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(40)] java.lang.IllegalArgumentException: array == null
E/flutter ( 6385): at android.opengl.Matrix.multiplyMM(Native Method)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2018)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge$SemanticsNode.updateRecursively(AccessibilityBridge.java:2060)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge$SemanticsNode.access$4100(AccessibilityBridge.java:1680)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge.updateSemantics(AccessibilityBridge.java:1237)
E/flutter ( 6385): at io.flutter.view.AccessibilityBridge$1.updateSemantics(AccessibilityBridge.java:268)
E/flutter ( 6385): at io.flutter.embedding.engine.FlutterJNI.updateSemantics(FlutterJNI.java:150)
E/flutter ( 6385): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 6385): at android.os.MessageQueue.next(MessageQueue.java:323)
E/flutter ( 6385): at android.os.Looper.loop(Looper.java:142)
E/flutter ( 6385): at android.app.ActivityThread.main(ActivityThread.java:6379)
E/flutter ( 6385): at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 6385): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/flutter ( 6385): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
E/flutter ( 6385):
F/flutter ( 6385): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(96)] Check failed: CheckException(env).
F/libc ( 6385): Fatal signal 6 (SIGABRT), code -6 in tid 6385 (m.biss.exchange)
Build fingerprint: 'xiaomi/tiffany/tiffany:7.1.2/N2G47H/V9.5.3.0.NDBCNFA:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 6385, tid: 6385, name: m.biss.exchange >>> com.biss.exchange <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(96)] Check failed: CheckException(env).
'
r0 00000000 r1 000018f1 r2 00000006 r3 00000008
r4 ea8de590 r5 00000006 r6 ea8de538 r7 0000010c
r8 ffffffff r9 e7c23310 sl ffffffff fp ffad479c
ip 0000000b sp ffad4658 lr e82562f7 pc e8258b78 cpsr 000f0010
backtrace:
#00 pc 00049b78 /system/lib/libc.so (tgkill+12)
#1 pc 000472f3 /system/lib/libc.so (pthread_kill+34)
#2 pc 0001d595 /system/lib/libc.so (raise+10)
#3 pc 000190e1 /system/lib/libc.so (__libc_android_abort+34)
#4 pc 00017144 /system/lib/libc.so (abort+4)
#5 pc 00af405b /data/app/com.biss.exchange-1/lib/arm/libflutter.so (offset 0xae6000)
#6 pc 00aeb22d /data/app/com.biss.exchange-1/lib/arm/libflutter.so (offset 0xae6000)
#7 pc 00aea30b /data/app/com.biss.exchange-1/lib/arm/libflutter.so (offset 0xae6000)
#8 pc 00b19471 /data/app/com.biss.exchange-1/lib/arm/libflutter.so (offset 0xae6000)
#9 pc 00af463f /data/app/com.biss.exchange-1/lib/arm/libflutter.so (offset 0xae6000)
#10 pc 00af7207 /data/app/com.biss.exchange-1/lib/arm/libflutter.so (offset 0xae6000)
#11 pc 00012027 /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+610)
#12 pc 00011d37 /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+26)
#13 pc 00093549 /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
#14 pc 01f0df4d /system/framework/arm/boot-framework.oat (offset 0x18c4000) (android.os.MessageQueue.nativePollOnce+96)
#15 pc 01f0f459 /system/framework/arm/boot-framework.oat (offset 0x18c4000) (android.os.MessageQueue.next+188)
#16 pc 01f0abeb /system/framework/arm/boot-framework.oat (offset 0x18c4000) (android.os.Looper.loop+366)
#17 pc 0194ebf5 /system/framework/arm/boot-framework.oat (offset 0x18c4000) (android.app.ActivityThread.main+496)
#18 pc 000a9ac1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
#19 pc 00406385 /system/lib/libart.so (art_quick_invoke_static_stub+228)
#20 pc 000b0d7f /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+178)
#21 pc 0031687d /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+56)
#22 pc 00317c0f /system/lib/libart.so (_ZN3art12InvokeMethodERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectS4_S4_j+766)
#23 pc 002bdd89 /system/lib/libart.so (ZN3artL13Method_invokeEP7_JNIEnvP8_jobjectS3_S3+40)
#24 pc 005afde9 /system/framework/arm/boot.oat (offset 0x51c000) (java.lang.reflect.Method.invoke+116)
#25 pc 0240ad49 /system/framework/arm/boot-framework.oat (offset 0x18c4000) (com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run+100)
#26 pc 0240bbe5 /system/framework/arm/boot-framework.oat (offset 0x18c4000) (com.android.internal.os.ZygoteInit.main+1240)
#27 pc 000a9ac1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
#28 pc 00406385 /system/lib/libart.so (art_quick_invoke_static_stub+228)
#29 pc 000b0d7f /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+178)
#30 pc 0031687d /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+56)
#31 pc 0031668f /system/lib/libart.so (_ZN3art17InvokeWithVarArgsERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDSt9__va_list+266)
#32 pc 002783f7 /system/lib/libart.so (_ZN3art3JNI21CallStaticVoidMethodVEP7_JNIEnvP7_jclassP10_jmethodIDSt9__va_list+426)
#33 pc 0006765d /system/lib/libandroid_runtime.so
#34 pc 00068f83 /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime5startEPKcRKNS_6VectorINS_7String8EEEb+574)
#35 pc 00001947 /system/bin/app_process32
#36 pc 00016d5d /system/lib/libc.so (__libc_init+48)
#37 pc 00001564 /system/bin/app_process32
huuang commentedon Apr 19, 2019
Device specs:
dnfield commentedon Apr 30, 2019
Does this reproduce with just any Flutter code, or is there a specific reproduction you can share?
nichoon commentedon May 1, 2019
It may have been caused by using our flutter view inside of a dialog fragment in android. I was finally able to bypass the error by changing our native android code to use our flutter view inside an activity rather than a dialog fragment and it stopped our crashes.
dnfield commentedon May 1, 2019
Does this bug still occur if you use the legacy method of add2app, or is it only in the new embedding?
dnfield commentedon May 1, 2019
Oh - you probably can't embed in a dialog fragment in the legacy embedding, can you?
dnfield commentedon May 1, 2019
/cc @matthew-carroll
dnfield commentedon May 3, 2019
At this point we suspect this is happening because of some bug in the framework code sending semantics over.
Does anyone reporting this bug have a reproduction for it (a Flutter app that reproduces this situation)?
lucaslcode commentedon May 12, 2019
Hi @dnfield, I'm getting this error in my app, not when I rotate, but when I open it in pop-up view on my Galaxy S7 (appears correctly for a half a second then crashes). Split-screen in emulator works. If you @ me I can email you a debug apk. Here is the stack trace:
Here is flutter doctor -v:
80 remaining items
[-]Crash on device during rotation[/-][+]Add test for fix of "Crash on device during rotation"[/+]Hixie commentedon Nov 13, 2019
@dnfield I'm moved the target milestone here and taken this off the critical list; please update as necessary when you have the opportunity. Thanks.
raycardillo commentedon Nov 21, 2019
Has anyone tested this with Platform Views that are embedded in a ListView? Because I was able to verify that the original problem has been solved, but then in another screen, we have a similar situation but the Platform Views are embedded in a ListView. In that case, I just rotate to cause several orientation changes, and after about 3 or 4 changes, it still crashes.
dnfield commentedon Nov 21, 2019
@raycardillo can you share the Java stack trace?
dnfield commentedon Nov 21, 2019
Actually, can you do so in a new bug? This one is a bit overloaded at this point. I'm sure we have other crashers/bugs in the Android a11y bridge, and there's probably fishy stuff related to PlatformViews in there as well. It'd be good to track things in their own issues.
Hixie commentedon Dec 4, 2019
Since this is only about a test, we find it unlikely it can be a blocker. If you are still experiencing a crash, please file a new bug (and mark it accordingly). Thanks.
LiGe888 commentedon Jun 3, 2020
still exist
github-actions commentedon Aug 20, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.