Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnityWidget Crashes and reboot mobile #573

Closed
riccardocescon opened this issue May 5, 2022 · 17 comments
Closed

UnityWidget Crashes and reboot mobile #573

riccardocescon opened this issue May 5, 2022 · 17 comments

Comments

@riccardocescon
Copy link

Describe the bug
When the UnityWIdget is loaded the app crashes, if i run it 2 times, the second one will make the mobile reboot after some seconds

To Reproduce
Build the app (Debug or Release)
Use the example main
Open the app
Crash

Expected behavior
Able to see the game scene

Unity (please complete the following information):

  • Version 2022.1.0b16.3019

Smartphone (please complete the following information):

  • Device: Pixel 6
  • OS: Android
  • Version 12

Additional context
I have the OpenGLES3 Graphics API
On Target Architectures i have ARMv7 and ARM64 checked
Scripting Backend is IL2CPP

Here's the error:
I/IL2CPP (25020): JNI_OnLoad D/FlutterUnityController(25020): Attaching unity to view D/FlutterUnityController(25020): onCreate D/FlutterUnityController(25020): onResume I/CustomUnityPlayer(25020): onAttachedToWindow I/ContentCaptureHelper(25020): Setting logging level to OFF I/Unity (25020): MemoryManager: Using 'Dynamic Heap' Allocator. W/e.flutter_unit(25020): Accessing hidden method Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V (unsupported, reflection, allowed) I/Unity (25020): SystemInfo CPU = ARM64 FP ASIMD AES, Cores = 8, Memory = 7592mb I/Unity (25020): SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf0), 4 little (mask: 0xf) I/Unity (25020): ApplicationInfo com.example.flutter_unity version 1.0.0 I/Unity (25020): Built from '2022.1/staging' branch, Version '2022.1.0b16 (098023fe5c31)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a', Stripping 'Enabled' E/e.flutter_unit(25020): C:/Users/Riccardo/Desktop/FlProjects/flutterUnity/flutter_unity/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/metadata/mono-hash.c:282: assertion 'hash != NULL' failed E/e.flutter_unit(25020): C:/Users/Riccardo/Desktop/FlProjects/flutterUnity/flutter_unity/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/metadata/mono-hash.c:442: assertion 'hash != NULL' failed E/e.flutter_unit(25020): C:/Users/Riccardo/Desktop/FlProjects/flutterUnity/flutter_unity/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/metadata/mono-hash.c:442: assertion 'hash != NULL' failed E/e.flutter_unit(25020): C:/Users/Riccardo/Desktop/FlProjects/flutterUnity/flutter_unity/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/metadata/mono-hash.c:442: assertion 'hash != NULL' failed F/e.flutter_unit(25020): * Assertion at C:/Users/Riccardo/Desktop/FlProjects/flutterUnity/flutter_unity/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/mini/debugger-agent.c:3427, condition tls' not met E/CRASH (25020): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** E/CRASH (25020): Version '2022.1.0b16 (098023fe5c31)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a' E/CRASH (25020): Build fingerprint: 'google/oriole/oriole:12/SP2A.220405.004/8233519:user/release-keys' E/CRASH (25020): Revision: 'MP1.0' E/CRASH (25020): ABI: 'arm64' E/CRASH (25020): Timestamp: 2022-05-05 21:51:23+0200 E/CRASH (25020): pid: 25020, tid: 25085, name: UnityMain >>> com.example.flutter_unity <<< E/CRASH (25020): uid: 10710 E/CRASH (25020): signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- E/CRASH (25020): x0 0000000000000000 x1 00000000000061fd x2 0000000000000006 x3 0000007a0ede1fb0 E/CRASH (25020): x4 6e63716062626851 x5 6e63716062626851 x6 6e63716062626851 x7 7f7f7f7f7f7f7f7f E/CRASH (25020): x8 00000000000000f0 x9 0000007d69c650b0 x10 0000000000000000 x11 ffffff80fffffbdf E/CRASH (25020): x12 0000000000000001 x13 00000000000000d0 x14 0000007a0eddfde0 x15 000008b5ee318e68 E/CRASH (25020): x16 0000007d69d02050 x17 0000007d69cdfbd0 x18 0000007a06ae8000 x19 00000000000061bc E/CRASH (25020): x20 00000000000061fd x21 00000000ffffffff x22 0000007a0ede5000 x23 0000007a0a9e2000 E/CRASH (25020): x24 0000007a969384c0 x25 0000000000000001 x26 0000000000000018 x27 0000007a0ede3000 E/CRASH (25020): x28 0000007a0d5c841c x29 0000007a0ede2030 E/CRASH (25020): sp 0000007a0ede1f90 lr 0000007d69c9272c pc 0000007d69c9275c E/CRASH (25020): backtrace: E/CRASH (25020): #00 pc 000000000004f75c /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 53a228529316d67f22e241dd17ea9b9e) E/CRASH (25020): #01 pc 0000000002a5e2f4 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/CRASH (25020): #02 pc 0000000002a5e168 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/CRASH (25020): #03 pc 0000000002a5e200 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/CRASH (25020): #04 pc 0000000002a5e22c /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/CRASH (25020): #05 pc 0000000002a77bdc /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/CRASH (25020): #06 pc 0000000002b16928 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/CRASH (25020): #07 pc 0000000002b1670c /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/CRASH (25020): #08 pc 0000000002ab4ee4 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/CRASH (25020): #09 pc 0000000002a9b6e0 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (il2cpp_init+28) (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/CRASH (25020): #10 pc 0000000000269e78 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libunity.so (BuildId: e8e3dbd7612021afdb05a4a10ba17b79cafc6ab0) E/CRASH (25020): #11 pc 00000000002df47c /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libunity.so (BuildId: e8e3dbd7612021afdb05a4a10ba17b79cafc6ab0) E/CRASH (25020): #12 pc 00000000002e1268 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libunity.so (BuildId: e8e3dbd7612021afdb05a4a10ba17b79cafc6ab0) E/CRASH (25020): #13 pc 00000000002f704c /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libunity.so (BuildId: e8e3dbd7612021afdb05a4a10ba17b79cafc6ab0) E/CRASH (25020): #14 pc 00000000002d4044 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #15 pc 00000000002ca764 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #18 pc 0000000000409ce0 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1580) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #19 pc 00000000002c4f94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #20 pc 000000000076ce1c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2120) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #21 pc 00000000002c5014 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #23 pc 000000000035a9e4 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+148) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #25 pc 00000000003d537c /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+4912) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #26 pc 00000000002c5094 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #27 pc 00000000002c0294 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+2292) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #28 pc 00000000002c4e94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #29 pc 000000000076ce1c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2120) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #30 pc 00000000002c5014 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #32 pc 000000000027c9e8 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1176) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #33 pc 00000000002d4178 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #34 pc 0000000000209188 /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #35 pc 00000000002ca764 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #38 pc 00000000004578ec /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+992) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/CRASH (25020): #39 pc 00000000000b1590 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: 53a228529316d67f22e241dd17ea9b9e) E/CRASH (25020): #40 pc 0000000000050fac /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 53a228529316d67f22e241dd17ea9b9e) W/OpenGLRenderer(25020): Surface doesn't have any previously queued frames, nothing to readback from [log] ********************************************* [log] ** flutter unity controller setup complete ** [log] ********************************************* E/CRASH (25020): Tombstone written to: /storage/emulated/0/Android/data/com.example.flutter_unity/files/tombstone_00 E/AndroidRuntime(25020): FATAL EXCEPTION: UnityMain E/AndroidRuntime(25020): Process: com.example.flutter_unity, PID: 25020 E/AndroidRuntime(25020): java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** E/AndroidRuntime(25020): Version '2022.1.0b16 (098023fe5c31)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a' E/AndroidRuntime(25020): Build fingerprint: 'google/oriole/oriole:12/SP2A.220405.004/8233519:user/release-keys' E/AndroidRuntime(25020): Revision: 'MP1.0' E/AndroidRuntime(25020): ABI: 'arm64' E/AndroidRuntime(25020): Timestamp: 2022-05-05 21:51:23+0200 E/AndroidRuntime(25020): pid: 25020, tid: 25085, name: UnityMain >>> com.example.flutter_unity <<< E/AndroidRuntime(25020): uid: 10710 E/AndroidRuntime(25020): signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- E/AndroidRuntime(25020): x0 0000000000000000 x1 00000000000061fd x2 0000000000000006 x3 0000007a0ede1fb0 E/AndroidRuntime(25020): x4 6e63716062626851 x5 6e63716062626851 x6 6e63716062626851 x7 7f7f7f7f7f7f7f7f E/AndroidRuntime(25020): x8 00000000000000f0 x9 0000007d69c650b0 x10 0000000000000000 x11 ffffff80fffffbdf E/AndroidRuntime(25020): x12 0000000000000001 x13 00000000000000d0 x14 0000007a0eddfde0 x15 000008b5ee318e68 E/AndroidRuntime(25020): x16 0000007d69d02050 x17 0000007d69cdfbd0 x18 0000007a06ae8000 x19 00000000000061bc E/AndroidRuntime(25020): x20 00000000000061fd x21 00000000ffffffff x22 0000007a0ede5000 x23 0000007a0a9e2000 E/AndroidRuntime(25020): x24 0000007a969384c0 x25 0000000000000001 x26 0000000000000018 x27 0000007a0ede3000 E/AndroidRuntime(25020): x28 0000007a0d5c841c x29 0000007a0ede2030 E/AndroidRuntime(25020): sp 0000007a0ede1f90 lr 0000007d69c9272c pc 0000007d69c9275c E/AndroidRuntime(25020): E/AndroidRuntime(25020): backtrace: E/AndroidRuntime(25020): #00 pc 000000000004f75c /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 53a228529316d67f22e241dd17ea9b9e) E/AndroidRuntime(25020): #01 pc 0000000002a5e2f4 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/AndroidRuntime(25020): #02 pc 0000000002a5e168 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/AndroidRuntime(25020): #03 pc 0000000002a5e200 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/AndroidRuntime(25020): #04 pc 0000000002a5e22c /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/AndroidRuntime(25020): #05 pc 0000000002a77bdc /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/AndroidRuntime(25020): #06 pc 0000000002b16928 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/AndroidRuntime(25020): #07 pc 0000000002b1670c /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/AndroidRuntime(25020): #08 pc 0000000002ab4ee4 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/AndroidRuntime(25020): #09 pc 0000000002a9b6e0 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libil2cpp.so (il2cpp_init+28) (BuildId: aa68711145cfe612302969d39d0b9e6ae1c927ab) E/AndroidRuntime(25020): #10 pc 0000000000269e78 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libunity.so (BuildId: e8e3dbd7612021afdb05a4a10ba17b79cafc6ab0) E/AndroidRuntime(25020): #11 pc 00000000002df47c /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libunity.so (BuildId: e8e3dbd7612021afdb05a4a10ba17b79cafc6ab0) E/AndroidRuntime(25020): #12 pc 00000000002e1268 /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libunity.so (BuildId: e8e3dbd7612021afdb05a4a10ba17b79cafc6ab0) E/AndroidRuntime(25020): #13 pc 00000000002f704c /data/app/~~d5QQtcj0yK2SAPzAGcMNTw==/com.example.flutter_unity-7IGToE8mPSEnzQaJPZdSIg==/lib/arm64/libunity.so (BuildId: e8e3dbd7612021afdb05a4a10ba17b79cafc6ab0) E/AndroidRuntime(25020): #14 pc 00000000002d4044 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #15 pc 00000000002ca764 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #18 pc 0000000000409ce0 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1580) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #19 pc 00000000002c4f94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #20 pc 000000000076ce1c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2120) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #21 pc 00000000002c5014 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #23 pc 000000000035a9e4 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+148) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #25 pc 00000000003d537c /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+4912) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #26 pc 00000000002c5094 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #27 pc 00000000002c0294 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+2292) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #28 pc 00000000002c4e94 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #29 pc 000000000076ce1c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2120) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #30 pc 00000000002c5014 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #32 pc 000000000027c9e8 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1176) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #33 pc 00000000002d4178 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #34 pc 0000000000209188 /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #35 pc 00000000002ca764 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #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: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #38 pc 00000000004578ec /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+992) (BuildId: 34e3dd028e2e682b63a512d6a4f1b5eb) E/AndroidRuntime(25020): #39 pc 00000000000b1590 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: 53a228529316d67f22e241dd17ea9b9e) E/AndroidRuntime(25020): #40 pc 0000000000050fac /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 53a228529316d67f22e241dd17ea9b9e) E/AndroidRuntime(25020): E/AndroidRuntime(25020): at libc.abort(abort:168) E/AndroidRuntime(25020): at libil2cpp.0x2a5e2f4(Native Method) E/AndroidRuntime(25020): at libil2cpp.0x2a5e168(Native Method) E/AndroidRuntime(25020): at libil2cpp.0x2a5e200(Native Method) E/AndroidRuntime(25020): at libil2cpp.0x2a5e22c(Native Method) E/AndroidRuntime(25020): at libil2cpp.0x2a77bdc(Native Method) E/AndroidRuntime(25020): at libil2cpp.0x2b16928(Native Method) E/AndroidRuntime(25020): at libil2cpp.0x2b1670c(Native Method) E/AndroidRuntime(25020): at libil2cpp.0x2ab4ee4(Native Method) E/AndroidRuntime(25020): at libil2cpp.il2cpp_init(il2cpp_init:28) E/AndroidRuntime(25020): at libunity.0x269e78(Native Method) E/AndroidRuntime(25020): at libunity.0x2df47c(Native Method) E/AndroidRuntime(25020): at libunity.0x2e1268(Native Method) E/AndroidRuntime(25020): at libunity.0x2f704c(Native Method) E/AndroidRuntime(25020): at libart.art_quick_generic_jni_trampoline(art_quick_generic_jni_trampoline:148) E/AndroidRuntime(25020): at libart.art_quick_invoke_stub(art_quick_invoke_stub:548) E/AndroidRuntime(25020): at libart.art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)(ArtInterpreterToCompiledCodeBridge:312) E/AndroidRuntime(25020): 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(25020): at libart.MterpInvokeDirect(MterpInvokeDirect:1580) E/AndroidRuntime(25020): at libart.mterp_op_invoke_direct(mterp_op_invoke_direct:20) E/AndroidRuntime(25020): at libart.MterpInvokeStatic(MterpInvokeStatic:2120) E/AndroidRuntime(25020): at libart.mterp_op_invoke_static(mterp_op_invoke_static:20) E/AndroidRuntime(25020): at libart.art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3351068054637636664)(Execute:644) E/AndroidRuntime(25020): at libart.art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)(ArtInterpreterToInterpreterBridge:148) E/AndroidRuntime(25020): 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(25020): at libart.MterpInvokeInterface(MterpInvokeInterface:4912) E/AndroidRuntime(25020): at libart.mterp_op_invoke_interface(mterp_op_invoke_interface:20) E/AndroidRuntime(25020): at libart.MterpInvokeVirtual(MterpInvokeVirtual:2292) E/AndroidRuntime(25020): at libart.mterp_op_invoke_virtual(mterp_op_invoke_virtual:20) E/AndroidRuntime(25020): at libart.MterpInvokeStatic(MterpInvokeStatic:2120) E/AndroidRuntime(25020): at libart.mterp_op_invoke_static(mterp_op_invoke_static:20) E/AndroidRuntime(25020): at libart.art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.3351068054637636664)(Execute:644) Lost connection to device. Exited (sigterm)
Did i do something wrong or is there an issue?

@riccardocescon
Copy link
Author

I tried with a Redmi Note 7 with Android 10 but the same thing happens

@riccardocescon
Copy link
Author

Hi @juicycleff ,
is there any knews?

@juicycleff
Copy link
Owner

@riccardocescon did you use the latest release and also could you confirm what you mean by running unity twice. Also I tested the example project and it works great.

@riccardocescon
Copy link
Author

@riccardocescon did you use the latest release and also could you confirm what you mean by running unity twice. Also I tested the example project and it works great.

Yes i am using flutter_unity_widget: ^2022.1.0+4
image
I am receiving the event, but it crashes after the message:
image

It says it fails an assertion 'hash != NULL' inside unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/metadata/mono-hash.c:282
does this have something to do with unity graphic api?

@riccardocescon
Copy link
Author

@riccardocescon did you use the latest release and also could you confirm what you mean by running unity twice. Also I tested the example project and it works great.

By second run i mean the next 'flutter run' after the crash

@juicycleff
Copy link
Owner

Might have to do with your graphic api, make sure to use OpenGL 3 for Android. Vulcan will work but might have some issues when hit loading flutter.

@riccardocescon
Copy link
Author

Might have to do with your graphic api, make sure to use OpenGL 3 for Android. Vulcan will work but might have some issues when hit loading flutter.

I have set OpenGLES3 as the README says, here's my settings:
image
image
image
most of that has nothing to do with the export to unity, but is there something wrong that is not present on the readme?
I think the library is okay because there is no one with this issue

@WalrusTheProud
Copy link

Has there been any progress on this inquiry? I'm having a similar problem. When I build for emulator I get the libmain.so missing error (I'm assuming this is because the emulator is x86, though thought I'd mention it in case its relevant), and when I build for my mobile physical device (Note 20, API level 31) the app simply closes out when I open the Unity scene with the same crash error as the one in the initially posted file output log:

Assertion at C:/Users/Riccardo/Desktop/FlProjects/flutterUnity/flutter_unity/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/mini/debugger-agent.c:3427, condition tls

(the file path is my own file path and user name where those apply)

I'm unsure why any of this is happening. If anyone has any insight I'd be very grateful!

For reference, all my files are the unedited export contents of the 2022.1.0+4 example project with the exception of the ndk address change in local.settings, and the import of uniyClasses.jar as a library in android studio. My Unity Project Settings look the same as @riccardocescon's settings.

Thanks! For anyone who takes the time to have a look at this problem, and I appreciate the library as a whole!

@riccardocescon
Copy link
Author

Has there been any progress on this inquiry? I'm having a similar problem. When I build for emulator I get the libmain.so missing error (I'm assuming this is because the emulator is x86, though thought I'd mention it in case its relevant), and when I build for my mobile physical device (Note 20, API level 31) the app simply closes out when I open the Unity scene with the same crash error as the one in the initially posted file output log:

Assertion at C:/Users/Riccardo/Desktop/FlProjects/flutterUnity/flutter_unity/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/mini/debugger-agent.c:3427, condition tls

(the file path is my own file path and user name where those apply)

I'm unsure why any of this is happening. If anyone has any insight I'd be very grateful!

For reference, all my files are the unedited export contents of the 2022.1.0+4 example project with the exception of the ndk address change in local.settings, and the import of uniyClasses.jar as a library in android studio. My Unity Project Settings look the same as @riccardocescon's settings.

Thanks! For anyone who takes the time to have a look at this problem, and I appreciate the library as a whole!

No sadly, i haven't fixed it yet. I am waitinf for a hint from @juicycleff, i know he has a lot of work so i paused this project for the moment hoping he will be free soon.
I tested it by changing some unity values but nothing changed, i think there is an issue with the library, but that would be weird, i mean it seems everyone made it work

@juicycleff
Copy link
Owner

Has there been any progress on this inquiry? I'm having a similar problem. When I build for emulator I get the libmain.so missing error (I'm assuming this is because the emulator is x86, though thought I'd mention it in case its relevant), and when I build for my mobile physical device (Note 20, API level 31) the app simply closes out when I open the Unity scene with the same crash error as the one in the initially posted file output log:

Assertion at C:/Users/Riccardo/Desktop/FlProjects/flutterUnity/flutter_unity/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/mini/debugger-agent.c:3427, condition tls

(the file path is my own file path and user name where those apply)

I'm unsure why any of this is happening. If anyone has any insight I'd be very grateful!

For reference, all my files are the unedited export contents of the 2022.1.0+4 example project with the exception of the ndk address change in local.settings, and the import of uniyClasses.jar as a library in android studio. My Unity Project Settings look the same as @riccardocescon's settings.

Thanks! For anyone who takes the time to have a look at this problem, and I appreciate the library as a whole!

You can't run the app against an emulator as stated in the readme. There are ways to do it, but it's not documented.

@juicycleff
Copy link
Owner

Has there been any progress on this inquiry? I'm having a similar problem. When I build for emulator I get the libmain.so missing error (I'm assuming this is because the emulator is x86, though thought I'd mention it in case its relevant), and when I build for my mobile physical device (Note 20, API level 31) the app simply closes out when I open the Unity scene with the same crash error as the one in the initially posted file output log:

Assertion at C:/Users/Riccardo/Desktop/FlProjects/flutterUnity/flutter_unity/android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/mono/mono/mini/debugger-agent.c:3427, condition tls

(the file path is my own file path and user name where those apply)

I'm unsure why any of this is happening. If anyone has any insight I'd be very grateful!

For reference, all my files are the unedited export contents of the 2022.1.0+4 example project with the exception of the ndk address change in local.settings, and the import of uniyClasses.jar as a library in android studio. My Unity Project Settings look the same as @riccardocescon's settings.

Thanks! For anyone who takes the time to have a look at this problem, and I appreciate the library as a whole!

No sadly, i haven't fixed it yet. I am waitinf for a hint from @juicycleff, i know he has a lot of work so i paused this project for the moment hoping he will be free soon.

I tested it by changing some unity values but nothing changed, i think there is an issue with the library, but that would be weird, i mean it seems everyone made it work

Your screenshots looks ok. It might have something to do with unity export. Could you share your unity export build.gradle file?

@riccardocescon
Copy link
Author

Here it is
Location: android/unityLibrary/build.gradle
Content:
`
apply plugin: 'com.android.library'

dependencies {
implementation(name: 'unity-classes', ext:'jar')

}

android {
compileSdkVersion 31
buildToolsVersion '29.0.2'

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
    minSdkVersion 22
    targetSdkVersion 31
    ndk {
        abiFilters 'armeabi-v7a', 'arm64-v8a'
    }
    versionCode 1
    versionName '0.1'
    consumerProguardFiles 'proguard-unity.txt'
}

lintOptions {
    abortOnError false
}

aaptOptions {
    noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.unityexp']
    ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}

packagingOptions {
    doNotStrip '*/armeabi-v7a/*.so'
    doNotStrip '*/arm64-v8a/*.so'
}

}

def getSdkDir() {
Properties local = new Properties()
local.load(new FileInputStream("${rootDir}/local.properties"))
return local.getProperty('sdk.dir')
}

def BuildIl2Cpp(String workingDir, String configuration, String architecture, String abi, String[] staticLibraries) {
def commandLineArgs = []
commandLineArgs.add("--compile-cpp")
commandLineArgs.add("--platform=Android")
commandLineArgs.add("--architecture=" + architecture)
commandLineArgs.add("--outputpath=" + workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.so")
commandLineArgs.add("--libil2cpp-static")
commandLineArgs.add("--baselib-directory=" + workingDir + "/src/main/jniStaticLibs/" + abi)
commandLineArgs.add("--incremental-g-c-time-slice=3")
commandLineArgs.add("--configuration=" + configuration)
commandLineArgs.add("--dotnetprofile=unityaot-linux")
commandLineArgs.add("--enable-debugger")
commandLineArgs.add("--profiler-report")
commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents")
commandLineArgs.add("--print-command-line")
commandLineArgs.add("--generatedcppdir=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput")
commandLineArgs.add("--cachedirectory=" + workingDir + "/build/il2cpp
"+ abi + "_" + configuration + "/il2cpp_cache")
commandLineArgs.add("--tool-chain-path=" + android.ndkDirectory)
staticLibraries.eachWithIndex {fileName, i->
commandLineArgs.add("--additional-libraries=" + workingDir + "/src/main/jniStaticLibs/" + abi + "/" + fileName)
}
def executableExtension = ""
if (org.gradle.internal.os.OperatingSystem.current().isWindows())
executableExtension = ".exe"
exec {
executable workingDir + "/src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp" + executableExtension
args commandLineArgs
environment "ANDROID_SDK_ROOT", getSdkDir()
}
delete workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.sym.so"
ant.move(file: workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.dbg.so", tofile: workingDir + "/symbols/" + abi + "/libil2cpp.so")
}

android {
task BuildIl2CppTask {
doLast {
BuildIl2Cpp(projectDir.toString().replaceAll('\\', '/'), 'Release', 'armv7', 'armeabi-v7a', [ ] as String[]);
BuildIl2Cpp(projectDir.toString().replaceAll('\\', '/'), 'Release', 'arm64', 'arm64-v8a', [ ] as String[]);
}
}
afterEvaluate {
if (project(':unityLibrary').tasks.findByName('mergeDebugJniLibFolders'))
project(':unityLibrary').mergeDebugJniLibFolders.dependsOn BuildIl2CppTask
if (project(':unityLibrary').tasks.findByName('mergeReleaseJniLibFolders'))
project(':unityLibrary').mergeReleaseJniLibFolders.dependsOn BuildIl2CppTask
}
sourceSets {
main {
jni.srcDirs = ["src/main/Il2CppOutputProject"]
}
}
}
`

@riccardocescon
Copy link
Author

Here it is
Location: android/unityLibrary/build.gradle
Content:
`
apply plugin: 'com.android.library'

dependencies {
implementation(name: 'unity-classes', ext:'jar')

}

android {
compileSdkVersion 31
buildToolsVersion '29.0.2'

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
    minSdkVersion 22
    targetSdkVersion 31
    ndk {
        abiFilters 'armeabi-v7a', 'arm64-v8a'
    }
    versionCode 1
    versionName '0.1'
    consumerProguardFiles 'proguard-unity.txt'
}

lintOptions {
    abortOnError false
}

aaptOptions {
    noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.unityexp']
    ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}

packagingOptions {
    doNotStrip '*/armeabi-v7a/*.so'
    doNotStrip '*/arm64-v8a/*.so'
}

}

def getSdkDir() {
Properties local = new Properties()
local.load(new FileInputStream("${rootDir}/local.properties"))
return local.getProperty('sdk.dir')
}

def BuildIl2Cpp(String workingDir, String configuration, String architecture, String abi, String[] staticLibraries) {
def commandLineArgs = []
commandLineArgs.add("--compile-cpp")
commandLineArgs.add("--platform=Android")
commandLineArgs.add("--architecture=" + architecture)
commandLineArgs.add("--outputpath=" + workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.so")
commandLineArgs.add("--libil2cpp-static")
commandLineArgs.add("--baselib-directory=" + workingDir + "/src/main/jniStaticLibs/" + abi)
commandLineArgs.add("--incremental-g-c-time-slice=3")
commandLineArgs.add("--configuration=" + configuration)
commandLineArgs.add("--dotnetprofile=unityaot-linux")
commandLineArgs.add("--enable-debugger")
commandLineArgs.add("--profiler-report")
commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents")
commandLineArgs.add("--print-command-line")
commandLineArgs.add("--generatedcppdir=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput")
commandLineArgs.add("--cachedirectory=" + workingDir + "/build/il2cpp
"+ abi + "_" + configuration + "/il2cpp_cache")
commandLineArgs.add("--tool-chain-path=" + android.ndkDirectory)
staticLibraries.eachWithIndex {fileName, i->
commandLineArgs.add("--additional-libraries=" + workingDir + "/src/main/jniStaticLibs/" + abi + "/" + fileName)
}
def executableExtension = ""
if (org.gradle.internal.os.OperatingSystem.current().isWindows())
executableExtension = ".exe"
exec {
executable workingDir + "/src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp" + executableExtension
args commandLineArgs
environment "ANDROID_SDK_ROOT", getSdkDir()
}
delete workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.sym.so"
ant.move(file: workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.dbg.so", tofile: workingDir + "/symbols/" + abi + "/libil2cpp.so")
}

android {
task BuildIl2CppTask {
doLast {
BuildIl2Cpp(projectDir.toString().replaceAll('\\', '/'), 'Release', 'armv7', 'armeabi-v7a', [ ] as String[]);
BuildIl2Cpp(projectDir.toString().replaceAll('\\', '/'), 'Release', 'arm64', 'arm64-v8a', [ ] as String[]);
}
}
afterEvaluate {
if (project(':unityLibrary').tasks.findByName('mergeDebugJniLibFolders'))
project(':unityLibrary').mergeDebugJniLibFolders.dependsOn BuildIl2CppTask
if (project(':unityLibrary').tasks.findByName('mergeReleaseJniLibFolders'))
project(':unityLibrary').mergeReleaseJniLibFolders.dependsOn BuildIl2CppTask
}
sourceSets {
main {
jni.srcDirs = ["src/main/Il2CppOutputProject"]
}
}
}
`

@juicycleff the unity project Is Just a simple cube like the example one, and the flutter Project Is just the main widget with the UnityWidget

@juicycleff
Copy link
Owner

commandLineArgs.add("--enable-debugger")
commandLineArgs.add("--profiler-report")
commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents")
commandLineArgs.add("--print-command-line")

Remove these lines

commandLineArgs.add("--enable-debugger")
commandLineArgs.add("--profiler-report")
commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents")
commandLineArgs.add("--print-command-line")

@WalrusTheProud
Copy link

commandLineArgs.add("--enable-debugger")
commandLineArgs.add("--profiler-report")
commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents")
commandLineArgs.add("--print-command-line")

Remove these lines

commandLineArgs.add("--enable-debugger") commandLineArgs.add("--profiler-report") commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents") commandLineArgs.add("--print-command-line")

YES! Perfect, that fixed it for me!

Thank you so much @juicycleff ! Out of curiosity, why might those have been the issue, and how did you go about debugging the issue? Also, thank you so much for taking the time to do so! Also also, I think you currently have those lines listed as possible targets for optimizing build speed in the readme, so it may be helpful to list their removal as a possible fix for this issue, as it was a problem for me out of the box.

Thanks again!

@riccardocescon
Copy link
Author

commandLineArgs.add("--enable-debugger")
commandLineArgs.add("--profiler-report")
commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents")
commandLineArgs.add("--print-command-line")

Remove these lines

commandLineArgs.add("--enable-debugger") commandLineArgs.add("--profiler-report") commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents") commandLineArgs.add("--print-command-line")

This fixed my issue!
Thank you @juicycleff for your effort and for building this free library!
I'd suggest to add this workaround as a Known error!
Thank you!

@trinhdinhdungcntt
Copy link

commandLineArgs.add("--enable-debugger")
commandLineArgs.add("--profiler-report")
commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents")
commandLineArgs.add("--print-command-line")

Remove these lines

commandLineArgs.add("--enable-debugger") commandLineArgs.add("--profiler-report") commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "" + configuration + "/il2cpp_conv.traceevents") commandLineArgs.add("--print-command-line")

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants