react-native-unity
react-native-unity copied to clipboard
unity crash with onDetachedFromWindow
Hi
First of all, thank you for great work. I've success build React, Unity and Expo with this source in debug and release environment. I should change some code for EAS build.
Unfortunately, I meet other problem. I used Material Top Tab Navigator. When I slide view, It was occurred crash in Unity. You can see that below code. I tested with ReactNativeUnity.addUnityViewToBackground() and without it. This error was occurred both case. I'm not sure why.
If you have any idea, please let me know.
Thanks.
https://user-images.githubusercontent.com/352759/163528341-f93af21e-2deb-4d2f-8ee7-52c3be48c0af.mp4
(Tree view is playing Unity side. Other are React components.)
04-15 13:58:06.916 28220 28392 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-15 13:58:06.916 28220 28392 E CRASH : Version '2020.3.30f1 (1fb1bf06830e)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
04-15 13:58:06.916 28220 28392 E CRASH : Build fingerprint: 'xiaomi/whyred/whyred:9/PKQ1.180904.001/V10.3.2.0.PEIMIXM:user/release-keys'
04-15 13:58:06.916 28220 28392 E CRASH : Revision: '0'
04-15 13:58:06.916 28220 28392 E CRASH : ABI: 'arm64'
04-15 13:58:06.916 28220 28392 E CRASH : Timestamp: 2022-04-15 13:58:06+0800
04-15 13:58:06.916 28220 28392 E CRASH : pid: 28220, tid: 28392, name: Thread-9 >>> bottlefactory.zeroclub <<<
04-15 13:58:06.916 28220 28392 E CRASH : uid: 10193
04-15 13:58:06.916 28220 28392 E CRASH : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
04-15 13:58:06.916 28220 28392 E CRASH : Cause: null pointer dereference
04-15 13:58:06.916 28220 28392 E CRASH : x0 0000000000000000 x1 00000077e75ff0b0 x2 0000000000000002 x3 0000000000000400
04-15 13:58:06.916 28220 28392 E CRASH : x4 0000000000000100 x5 0000000000000001 x6 00000077fcc6e510 x7 00000000010c9c70
04-15 13:58:06.916 28220 28392 E CRASH : x8 0000006be120f220 x9 0000000000000630 x10 0000000000000010 x11 0000000000000000
04-15 13:58:06.916 28220 28392 E CRASH : x12 00000000000001ff x13 0000006e8a9289ec x14 00000078110ad000 x15 0000007ffedcd300
04-15 13:58:06.916 28220 28392 E CRASH : x16 0000006ea1c06950 x17 00000078a4aa83bc x18 00000077fcc6e510 x19 0000006be0c7e0c0
04-15 13:58:06.916 28220 28392 E CRASH : x20 0000006be120f220 x21 0000006be0c7e0c0 x22 0000006e2004b350 x23 0000000000000050
04-15 13:58:06.916 28220 28392 E CRASH : x24 0000000000000001 x25 0000006be0c8eb90 x26 0000006be0c98e30 x27 0000087000000438
04-15 13:58:06.916 28220 28392 E CRASH : x28 0000006be047af60 x29 00000077e75ff420
04-15 13:58:06.916 28220 28392 E CRASH : sp 00000077e75ff0b0 lr 0000006ea122fb3c pc 0000006ea122fb5c
04-15 13:58:06.916 28220 28392 E CRASH :
04-15 13:58:06.916 28220 28392 E CRASH : backtrace:
04-15 13:58:06.916 28220 28392 E CRASH : #00 pc 0000000000360b5c /data/app/bottlefactory.zeroclub-_l1suaygCHDoOrBL5inNJw==/lib/arm64/libunity.so (BuildId: 01009ea89d8cb9d3861e46fd28d5fccf7235847b)
04-15 13:58:06.916 28220 28392 E CRASH : #01 pc 0000000000370804 /data/app/bottlefactory.zeroclub-_l1suaygCHDoOrBL5inNJw==/lib/arm64/libunity.so (BuildId: 01009ea89d8cb9d3861e46fd28d5fccf7235847b)
04-15 13:58:06.916 28220 28392 E CRASH : #02 pc 0000000000353ec0 /data/app/bottlefactory.zeroclub-_l1suaygCHDoOrBL5inNJw==/lib/arm64/libunity.so (BuildId: 01009ea89d8cb9d3861e46fd28d5fccf7235847b)
04-15 13:58:06.916 28220 28392 E CRASH : #03 pc 000000000034f510 /data/app/bottlefactory.zeroclub-_l1suaygCHDoOrBL5inNJw==/lib/arm64/libunity.so (BuildId: 01009ea89d8cb9d3861e46fd28d5fccf7235847b)
04-15 13:58:06.916 28220 28392 E CRASH : #04 pc 000000000068f7c8 /data/app/bottlefactory.zeroclub-_l1suaygCHDoOrBL5inNJw==/lib/arm64/libunity.so (BuildId: 01009ea89d8cb9d3861e46fd28d5fccf7235847b)
04-15 13:58:06.916 28220 28392 E CRASH : #05 pc 0000000000691938 /data/app/bottlefactory.zeroclub-_l1suaygCHDoOrBL5inNJw==/lib/arm64/libunity.so (BuildId: 01009ea89d8cb9d3861e46fd28d5fccf7235847b)
04-15 13:58:06.916 28220 28392 E CRASH : #06 pc 0000000000689670 /data/app/bottlefactory.zeroclub-_l1suaygCHDoOrBL5inNJw==/lib/arm64/libunity.so (BuildId: 01009ea89d8cb9d3861e46fd28d5fccf7235847b)
04-15 13:58:06.916 28220 28392 E CRASH : #07 pc 0000000000252540 /data/app/bottlefactory.zeroclub-_l1suaygCHDoOrBL5inNJw==/lib/arm64/libunity.so (BuildId: 01009ea89d8cb9d3861e46fd28d5fccf7235847b)
04-15 13:58:06.917 28220 28392 E CRASH : #08 pc 0000000000090328 /system/lib64/libc.so (__pthread_start(void*)+36) (BuildId: f82474d2188d0c21e110184220b5e386)
04-15 13:58:06.917 28220 28392 E CRASH : #09 pc 0000000000023a28 /system/lib64/libc.so (__start_thread+68) (BuildId: f82474d2188d0c21e110184220b5e386)
04-15 13:58:06.942 28220 28220 W ZeroClub: onDetachedFromWindow

Hi! Similar problems are associated with the assembly of the Unity project and its settings. Try setting this checkbox
Yeah~~ It's solved!! Thanks again~!!!
I just have other question. Why need ReactNativeUnity.addUnityViewToBackground();? In my case, onDetachedFromWindow was call after slide on Tab Navigator. I will remove in my code. Is it ok?
you can of course try to remove it, but in this case the unit will not correctly stop when the component closes and may lead to application errors. on my project without this function nothing works
Hi! Similar problems are associated with the assembly of the Unity project and its settings. Try setting this checkbox
I am having the same error as here mentioned in the mentioned issue above this comment - what auto graphics APIs do you have when the tickbox is unchecked and how is this related to the crash?