flutter-unity-view-widget
flutter-unity-view-widget copied to clipboard
Immediate crash on Android
Describe the bug
When I build from Android Studio for my physical device, it successfully builds and installs the APK, but as soon as the UnityView
launches, the app crashes. I included the logs. Does anyone have an idea what might be causing this?
Expand Log
Launching lib\main.dart on Pixel 6 in debug mode...
Running Gradle task 'assembleDebug'...
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\Users\thijs\Projects\{redacted}\{redacted}\flutter_unity_widget_test\android\unityLibrary\src\main\Il2CppOutputProject\IL2CPP\build\deploy\il2cpp.exe --compile-cpp --platform=Android --architecture=armv7 --outputpath=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/jniLibs/armeabi-v7a/libil2cpp.so --libil2cpp-static --baselib-directory=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/jniStaticLibs/armeabi-v7a --incremental-g-c-time-slice=3 --configuration=Release --dotnetprofile=unityaot-linux --enable-debugger --profiler-report --profiler-output-file=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_armeabi-v7a_Release/il2cpp_conv.traceevents --print-command-line --generatedcppdir=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/Il2CppOutputProject/Source/il2cppOutput --cachedirectory=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_armeabi-v7a_Release/il2cpp_cache --tool-chain-path=C:\Program Files\Unity\Hub\Editor\2022.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
Starting: C:\Users\thijs\Projects\{redacted}\{redacted}\flutter_unity_widget_test\android\unityLibrary\src\main\Il2CppOutputProject\IL2CPP\build\deploy\bee_backend\win-x64\bee_backend.exe --profile="C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_armeabi-v7a_Release/il2cpp_cache/buildstate/backend_profiler0.traceevents" --stdin-canary --dagfile="C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_armeabi-v7a_Release/il2cpp_cache/buildstate/bee.dag" --continue-on-failure FinalProgram
WorkingDir: C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_armeabi-v7a_Release/il2cpp_cache/buildstate
ExitCode: 0 Duration: 0s545ms
Build succeeded with 2 successful nodes and 0 failed ones
C:\Users\thijs\Projects\{redacted}\{redacted}\flutter_unity_widget_test\android\unityLibrary\src\main\Il2CppOutputProject\IL2CPP\build\deploy\il2cpp.exe --compile-cpp --platform=Android --architecture=arm64 --outputpath=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/jniLibs/arm64-v8a/libil2cpp.so --libil2cpp-static --baselib-directory=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/jniStaticLibs/arm64-v8a --incremental-g-c-time-slice=3 --configuration=Release --dotnetprofile=unityaot-linux --enable-debugger --profiler-report --profiler-output-file=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_conv.traceevents --print-command-line --generatedcppdir=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/Il2CppOutputProject/Source/il2cppOutput --cachedirectory=C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_cache --tool-chain-path=C:\Program Files\Unity\Hub\Editor\2022.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
Starting: C:\Users\thijs\Projects\{redacted}\{redacted}\flutter_unity_widget_test\android\unityLibrary\src\main\Il2CppOutputProject\IL2CPP\build\deploy\bee_backend\win-x64\bee_backend.exe --profile="C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_cache/buildstate/backend_profiler0.traceevents" --stdin-canary --dagfile="C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_cache/buildstate/bee.dag" --continue-on-failure FinalProgram
WorkingDir: C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/build/il2cpp_arm64-v8a_Release/il2cpp_cache/buildstate
ExitCode: 0 Duration: 0s723ms
Build succeeded with 2 successful nodes and 0 failed ones
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Debug service listening on ws://127.0.0.1:62076/WHfcXpdV1_4=/ws
Syncing files to device Pixel 6...
I/IL2CPP (10907): JNI_OnLoad
D/FlutterUnityController(10907): Attaching unity to view
D/FlutterUnityController(10907): onCreate
D/FlutterUnityController(10907): onResume
E/Surface (10907): freeAllBuffers: 1 buffers were freed while being dequeued!
I/CustomUnityPlayer(10907): onAttachedToWindow
[log] *********************************************
[log] ** flutter unity controller setup complete **
[log] *********************************************
I/Unity (10907): MemoryManager: Using 'Dynamic Heap' Allocator.
W/ity_widget_tes(10907): Accessing hidden method Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V (unsupported, reflection, allowed)
I/Unity (10907): SystemInfo CPU = ARM64 FP ASIMD AES, Cores = 8, Memory = 7592mb
I/Unity (10907): SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf0), 4 little (mask: 0xf)
I/Unity (10907): ApplicationInfo com.example.flutter_unity_widget_test version 1.0.0
I/Unity (10907): Built from '2022.1/staging' branch, Version '2022.1.1f1 (53d13f540f71)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a', Stripping 'Enabled'
E/ity_widget_tes(10907): C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/metadata/mono-hash.c:282: assertion 'hash != NULL' failed
E/ity_widget_tes(10907): C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/metadata/mono-hash.c:442: assertion 'hash != NULL' failed
E/ity_widget_tes(10907): C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/metadata/mono-hash.c:442: assertion 'hash != NULL' failed
E/ity_widget_tes(10907): C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/metadata/mono-hash.c:442: assertion 'hash != NULL' failed
F/ity_widget_tes(10907): * Assertion at C:/Users/thijs/Projects/{redacted}/{redacted}/flutter_unity_widget_test/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/mini/debugger-agent.c:3427, condition `tls' not met
E/CRASH (10907): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/CRASH (10907): Version '2022.1.1f1 (53d13f540f71)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
E/CRASH (10907): Build fingerprint: 'google/oriole/oriole:12/SP2A.220505.002/8353555:user/release-keys'
E/CRASH (10907): Revision: 'MP1.0'
E/CRASH (10907): ABI: 'arm64'
E/CRASH (10907): Timestamp: 2022-06-15 17:16:07+0200
E/CRASH (10907): pid: 10907, tid: 10977, name: UnityMain >>> com.example.flutter_unity_widget_test <<<
E/CRASH (10907): uid: 10312
E/CRASH (10907): signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
E/CRASH (10907): x0 0000000000000000 x1 0000000000002ae1 x2 0000000000000006 x3 0000006d581f8fb0
E/CRASH (10907): x4 714f2e7269686773 x5 714f2e7269686773 x6 714f2e7269686773 x7 7f7f7f7f7f7f7f7f
E/CRASH (10907): x8 00000000000000f0 x9 00000070aa7cc0b0 x10 0000000000000000 x11 ffffff80fffffbdf
E/CRASH (10907): x12 0000000000000001 x13 00000000000000d1 x14 0000006d581f6de0 x15 00000807c9965c90
E/CRASH (10907): x16 00000070aa869050 x17 00000070aa846bd0 x18 0000006d56978000 x19 0000000000002a9b
E/CRASH (10907): x20 0000000000002ae1 x21 00000000ffffffff x22 0000006d581fc000 x23 0000006d3dd30000
E/CRASH (10907): x24 0000006de0709688 x25 0000000000000001 x26 0000000000000018 x27 0000006d581fa000
E/CRASH (10907): x28 0000006d57dafb89 x29 0000006d581f9030
E/CRASH (10907): sp 0000006d581f8f90 lr 00000070aa7f972c pc 00000070aa7f975c
E/CRASH (10907): backtrace:
E/CRASH (10907): #00 pc 000000000004f75c /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 53a228529316d67f22e241dd17ea9b9e)
E/CRASH (10907): #01 pc 00000000044340f4 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/CRASH (10907): #02 pc 0000000004433f68 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/CRASH (10907): #03 pc 0000000004434000 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/CRASH (10907): #04 pc 000000000443402c /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/CRASH (10907): #05 pc 00000000044493e4 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/CRASH (10907): #06 pc 00000000044de178 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/CRASH (10907): #07 pc 00000000044ddf5c /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/CRASH (10907): #08 pc 0000000004473d78 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/CRASH (10907): #09 pc 00000000044e6f3c /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (il2cpp_init+28) (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/CRASH (10907): #10 pc 000000000026a054 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libunity.so (BuildId: 3db7502192bff0ddc8132ad0008d28f7c9098fe1)
E/CRASH (10907): #11 pc 00000000002df6d8 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libunity.so (BuildId: 3db7502192bff0ddc8132ad0008d28f7c9098fe1)
E/CRASH (10907): #12 pc 00000000002e04c4 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libunity.so (BuildId: 3db7502192bff0ddc8132ad0008d28f7c9098fe1)
E/CRASH (10907): #13 pc 00000000002f6280 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libunity.so (BuildId: 3db7502192bff0ddc8132ad0008d28f7c9098fe1)
E/CRASH (10907): #14 pc 00000000002d4044 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #15 pc 00000000002ca764 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #16 pc 00000000002ee6b0 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+312) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #17 pc 000000000040ade4 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+820) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #18 pc 0000000000409ce0 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1580) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #19 pc 00000000002c4f94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #20 pc 000000000076ce1c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2120) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #21 pc 00000000002c5014 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #22 pc 000000000027d840 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3351068054637636664)+644) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #23 pc 000000000035a9e4 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+148) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #24 pc 000000000040b05c /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1452) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #25 pc 00000000003d537c /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+4912) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #26 pc 00000000002c5094 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #27 pc 00000000002c0294 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+2292) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #28 pc 00000000002c4e94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #29 pc 000000000076ce1c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2120) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #30 pc 00000000002c5014 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #31 pc 000000000027d840 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3351068054637636664)+644) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #32 pc 000000000027c9e8 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1176) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #33 pc 00000000002d4178 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #34 pc 0000000000209188 /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #35 pc 00000000002ca764 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #36 pc 000000000030e980 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+156) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #37 pc 00000000003c1db4 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+380) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #38 pc 00000000004578ec /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+992) (BuildId: 46df93bc978921840e5b428398c66a57)
E/CRASH (10907): #39 pc 00000000000b1590 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: 53a228529316d67f22e241dd17ea9b9e)
E/CRASH (10907): #40 pc 0000000000050fac /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 53a228529316d67f22e241dd17ea9b9e)
E/CRASH (10907): Tombstone written to: /storage/emulated/0/Android/data/com.example.flutter_unity_widget_test/files/tombstone_02
E/AndroidRuntime(10907): FATAL EXCEPTION: UnityMain
E/AndroidRuntime(10907): Process: com.example.flutter_unity_widget_test, PID: 10907
E/AndroidRuntime(10907): java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
E/AndroidRuntime(10907): Version '2022.1.1f1 (53d13f540f71)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
E/AndroidRuntime(10907): Build fingerprint: 'google/oriole/oriole:12/SP2A.220505.002/8353555:user/release-keys'
E/AndroidRuntime(10907): Revision: 'MP1.0'
E/AndroidRuntime(10907): ABI: 'arm64'
E/AndroidRuntime(10907): Timestamp: 2022-06-15 17:16:07+0200
E/AndroidRuntime(10907): pid: 10907, tid: 10977, name: UnityMain >>> com.example.flutter_unity_widget_test <<<
E/AndroidRuntime(10907): uid: 10312
E/AndroidRuntime(10907): signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
E/AndroidRuntime(10907): x0 0000000000000000 x1 0000000000002ae1 x2 0000000000000006 x3 0000006d581f8fb0
E/AndroidRuntime(10907): x4 714f2e7269686773 x5 714f2e7269686773 x6 714f2e7269686773 x7 7f7f7f7f7f7f7f7f
E/AndroidRuntime(10907): x8 00000000000000f0 x9 00000070aa7cc0b0 x10 0000000000000000 x11 ffffff80fffffbdf
E/AndroidRuntime(10907): x12 0000000000000001 x13 00000000000000d1 x14 0000006d581f6de0 x15 00000807c9965c90
E/AndroidRuntime(10907): x16 00000070aa869050 x17 00000070aa846bd0 x18 0000006d56978000 x19 0000000000002a9b
E/AndroidRuntime(10907): x20 0000000000002ae1 x21 00000000ffffffff x22 0000006d581fc000 x23 0000006d3dd30000
E/AndroidRuntime(10907): x24 0000006de0709688 x25 0000000000000001 x26 0000000000000018 x27 0000006d581fa000
E/AndroidRuntime(10907): x28 0000006d57dafb89 x29 0000006d581f9030
E/AndroidRuntime(10907): sp 0000006d581f8f90 lr 00000070aa7f972c pc 00000070aa7f975c
E/AndroidRuntime(10907):
E/AndroidRuntime(10907): backtrace:
E/AndroidRuntime(10907): #00 pc 000000000004f75c /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 53a228529316d67f22e241dd17ea9b9e)
E/AndroidRuntime(10907): #01 pc 00000000044340f4 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/AndroidRuntime(10907): #02 pc 0000000004433f68 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/AndroidRuntime(10907): #03 pc 0000000004434000 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/AndroidRuntime(10907): #04 pc 000000000443402c /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/AndroidRuntime(10907): #05 pc 00000000044493e4 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/AndroidRuntime(10907): #06 pc 00000000044de178 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/AndroidRuntime(10907): #07 pc 00000000044ddf5c /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/AndroidRuntime(10907): #08 pc 0000000004473d78 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/AndroidRuntime(10907): #09 pc 00000000044e6f3c /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libil2cpp.so (il2cpp_init+28) (BuildId: 87e7b1977c9fe10698257f9af79d5ab88a9b72bb)
E/AndroidRuntime(10907): #10 pc 000000000026a054 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libunity.so (BuildId: 3db7502192bff0ddc8132ad0008d28f7c9098fe1)
E/AndroidRuntime(10907): #11 pc 00000000002df6d8 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libunity.so (BuildId: 3db7502192bff0ddc8132ad0008d28f7c9098fe1)
E/AndroidRuntime(10907): #12 pc 00000000002e04c4 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libunity.so (BuildId: 3db7502192bff0ddc8132ad0008d28f7c9098fe1)
E/AndroidRuntime(10907): #13 pc 00000000002f6280 /data/app/~~s13skhJrWx-vmxaWilAP5Q==/com.example.flutter_unity_widget_test-kxxfFQlBa3QjkhCJXcYcEw==/lib/arm64/libunity.so (BuildId: 3db7502192bff0ddc8132ad0008d28f7c9098fe1)
E/AndroidRuntime(10907): #14 pc 00000000002d4044 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #15 pc 00000000002ca764 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #16 pc 00000000002ee6b0 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+312) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #17 pc 000000000040ade4 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+820) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #18 pc 0000000000409ce0 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1580) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #19 pc 00000000002c4f94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #20 pc 000000000076ce1c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2120) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #21 pc 00000000002c5014 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #22 pc 000000000027d840 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3351068054637636664)+644) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #23 pc 000000000035a9e4 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+148) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #24 pc 000000000040b05c /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1452) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #25 pc 00000000003d537c /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+4912) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #26 pc 00000000002c5094 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #27 pc 00000000002c0294 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+2292) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #28 pc 00000000002c4e94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #29 pc 000000000076ce1c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2120) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #30 pc 00000000002c5014 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #31 pc 000000000027d840 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3351068054637636664)+644) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #32 pc 000000000027c9e8 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1176) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #33 pc 00000000002d4178 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #34 pc 0000000000209188 /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #35 pc 00000000002ca764 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #36 pc 000000000030e980 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+156) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #37 pc 00000000003c1db4 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+380) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #38 pc 00000000004578ec /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+992) (BuildId: 46df93bc978921840e5b428398c66a57)
E/AndroidRuntime(10907): #39 pc 00000000000b1590 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: 53a228529316d67f22e241dd17ea9b9e)
E/AndroidRuntime(10907): #40 pc 0000000000050fac /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 53a228529316d67f22e241dd17ea9b9e)
E/AndroidRuntime(10907):
E/AndroidRuntime(10907): at libc.abort(abort:168)
E/AndroidRuntime(10907): at libil2cpp.0x44340f4(Native Method)
E/AndroidRuntime(10907): at libil2cpp.0x4433f68(Native Method)
E/AndroidRuntime(10907): at libil2cpp.0x4434000(Native Method)
E/AndroidRuntime(10907): at libil2cpp.0x443402c(Native Method)
E/AndroidRuntime(10907): at libil2cpp.0x44493e4(Native Method)
E/AndroidRuntime(10907): at libil2cpp.0x44de178(Native Method)
E/AndroidRuntime(10907): at libil2cpp.0x44ddf5c(Native Method)
E/AndroidRuntime(10907): at libil2cpp.0x4473d78(Native Method)
E/AndroidRuntime(10907): at libil2cpp.il2cpp_init(il2cpp_init:28)
E/AndroidRuntime(10907): at libunity.0x26a054(Native Method)
E/AndroidRuntime(10907): at libunity.0x2df6d8(Native Method)
E/AndroidRuntime(10907): at libunity.0x2e04c4(Native Method)
E/AndroidRuntime(10907): at libunity.0x2f6280(Native Method)
E/AndroidRuntime(10907): at libart.art_quick_generic_jni_trampoline(art_quick_generic_jni_trampoline:148)
E/AndroidRuntime(10907): at libart.art_quick_invoke_stub(art_quick_invoke_stub:548)
E/AndroidRuntime(10907): at libart.art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)(ArtInterpreterToCompiledCodeBridge:312)
E/AndroidRuntime(10907): at libart.bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)(DoCall<false, false>:820)
E/AndroidRuntime(10907): at libart.MterpInvokeDirect(MterpInvokeDirect:1580)
E/AndroidRuntime(10907): at libart.mterp_op_invoke_direct(mterp_op_invoke_direct:20)
E/AndroidRuntime(10907): at libart.MterpInvokeStatic(MterpInvokeStatic:2120)
E/AndroidRuntime(10907): at libart.mterp_op_invoke_static(mterp_op_invoke_static:20)
E/AndroidRuntime(10907): at libart.art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3351068054637636664)(Execute:644)
E/AndroidRuntime(10907): at libart.art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)(ArtInterpreterToInterpreterBridge:148)
E/AndroidRuntime(10907): at libart.bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)(DoCall<false, false>:1452)
E/AndroidRuntime(10907): at libart.MterpInvokeInterface(MterpInvokeInterface:4912)
E/AndroidRuntime(10907): at libart.mterp_op_invoke_interface(mterp_op_invoke_interface:20)
E/AndroidRuntime(10907): at libart.MterpInvokeVirtual(MterpInvokeVirtual:2292)
E/AndroidRuntime(10907): at libart.mterp_op_invoke_virtual(mterp_op_invoke_virtual:20)
E/AndroidRuntime(10907): at libart.MterpInvokeStatic(MterpInvokeStatic:2120)
E/AndroidRuntime(10907): at libart.mterp_op_invoke_static(mterp_op_invoke_static:20)
E/AndroidRuntime(10907): at libart.art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3351068054637636664)(Execute:644)
D/FlutterUnityController(10907): onPause
I/Process (10907): Sending signal. PID: 10907 SIG: 9
Lost connection to device.
To Reproduce I'm not sure if this is easy to reproduce, it might be very specific to my environment? But here are the steps I took to get here. I've actually tried a bunch of different configurations, but the steps below are the most logical ones, which I've tried at least two times from scratch, and I've also used several different physical android devices, but always with the same result.
- I've followed the exact steps in the readme.
- I'm using the right combination of versions of everything:
- Flutter v3.0.2 (though I've also tried v3.0.0 and 2.10.5)
- Unity 2022.1.1f1 with the matching version of the FlutterUnityPackage
-
flutter_unity_widget
2022.1.1+3
- I edited the
FlutterUnityIntegration/NativeAPI.cs
to addusing System;
andusing UnityEngine;
because the compiler complained that it couldn't find several classes, includingAndroidJavaObject
andException
. - I have disabled Vulkan in the Unity player settings, so Unity is built for OpenGLES3
- I have copy pasted the
UnityDemoScreen
from the example at the bottom of the readme. - I have updated the minSdkVersion (to
22
) and the ndkVersion (to21.3.6528147
, since that's what Unity provides) inandroid/app/build.gradle
Expected behavior No crash ;)
Versions
- Host OS: Windows 11
- Unity: 2022.1.1f
- Flutter: 3.0.2 (but also tried 3.0.0 and 2.10.5)
- flutter_unity_widget: 2022.1.1+3
Smartphone (please complete the following information):
- Device: Pixel 6
- OS: Android
- Version: 12
Me too having the same issue..it gets crahsed..
eventually thix could fix it: https://github.com/juicycleff/flutter-unity-view-widget/issues/620
Thanks for the suggestion @Ahmadre! Unfortunately though, it didn't change anything for me.
I'm just running a debug build, so I'm not sure proguard is actually active (though I'm not very familiar with proguard so maybe I misunderstand that), and I'm also not using ARFoundation, so I think the app isn't requesting camera access. I suspect the crash is caused by something else in my case.
Thanks for the suggestion @Ahmadre! Unfortunately though, it didn't change anything for me.
I'm just running a debug build, so I'm not sure proguard is actually active (though I'm not very familiar with proguard so maybe I misunderstand that), and I'm also not using ARFoundation, so I think the app isn't requesting camera access. I suspect the crash is caused by something else in my case.
Then maybe your Unity-Android is broken. This is due to a Unity-Bug in either 2021.* or 2022.* Unity Version.
Try to build android through the unitypackage with 2021 and 2022 and look which version functions.
I solved a random crash like that.
Ah ok, I'll try with 2021! However, I don't see a 2021 unitypackage in the unitypackages dir, or would it be one of the v4 packages?
Ah ok, I'll try with 2021! However, I don't see a 2021 unitypackage in the unitypackages dir, or would it be one of the v4 packages?
please use the latest unitypackage here :) it works for 2021 and 2022
Any luck with this?
Solved in https://github.com/juicycleff/flutter-unity-view-widget/issues/629 for Unity 2022.1
Disable script debugging.
// Assets/FlutterUnityIntegration/Editor/build.cs DoBuildAndroid()
//remove this line
playerOptions.options = BuildOptions.AllowDebugging;