BabylonReactNative icon indicating copy to clipboard operation
BabylonReactNative copied to clipboard

Android Crash on RN 0.68+

Open kerryaustin opened this issue 3 years ago • 1 comments
trafficstars

Describe the bug Android immediately crashes when calling useEngine on RN 0.68+

To Reproduce Call useEngine in a mounted react component

Expected behavior Android does not crash

Other

  • Platform: Android (iOS works fine, haven't tested others)

Here is a repo with the reproduction: https://github.com/kerryaustin/RNBabylon68 (using the 1.3.0-preview versions of BJS RN due to the maven issue #410 )

kerryaustin avatar Aug 03 '22 16:08 kerryaustin

Related to #388

ryantrem avatar Aug 04 '22 18:08 ryantrem

@kerryaustin Are you using emulator or real device?

See https://github.com/BabylonJS/BabylonReactNative/issues/375#issuecomment-1221601572

gomes042 avatar Aug 21 '22 19:08 gomes042

@runtothedoor Sorry for the late reply.

I am using on an emulator (don't have a real device handy). I have tried on both Mac and Windows emulators through Android Studio. WRT #375 , it is crashing on all API levels ive tried (29, 30, 31, 33)

I made sure to use the Open GL 3.x renderer on the emulator

kerryaustin avatar Aug 25 '22 20:08 kerryaustin

@bghgary @CedricGuillemet @ryantrem

Anyone using windows? Does what I said make any sense? Maybe it's not a Babylon Native or bgfx issue...

gomes042 avatar Aug 25 '22 21:08 gomes042

Anyone using windows?

Yes, I'm using Windows for Android. The majority of the team is also.

Does what I said make any sense?

What are you referring to? This? I can run the emulator without crashing, but it shows a black screen for some scenarios (e.g. loading certain textures).

bghgary avatar Aug 25 '22 21:08 bghgary

Anyone using windows?

Yes, I'm using Windows for Android. The majority of the team is also.

Does what I said make any sense?

What are you referring to? This? I can run the emulator without crashing, but it shows a black screen for some scenarios (e.g. loading certain textures).

Yes. In my case I had different problems depending on the emulator I tried on Windows. (Android Studio's Emulator, VirtualBox with Android-x86). Some applications crashed, others also showed black screen, but in real devices everything always worked as expected, Mac (M1) with Android Studio Emulator seems okay as well...

I haven't tried with game-focused emulators (ex: BlueStacks, Nox Player). Now, I don't know if it makes sense, from what I've researched some people on the internet have commented on these emulator issues on Windows. But if you take applications like Android Studio's camera (Virtual 3D Enviroment), things run fine...

gomes042 avatar Aug 25 '22 21:08 gomes042

I haven't used the emulator in a long time since it doesn't work well. I only use it if I'm running something very simple.

bghgary avatar Aug 25 '22 21:08 bghgary

@bghgary I added a link to a repo above that is very bare bones does that crash for you? Basically even just a call to useEngine crashes the emulator for me. I am on an intel mac btw.

kerryaustin avatar Aug 25 '22 22:08 kerryaustin

I have tested Android9, Android12, Android10 on different real machines and I am sure it will crash on Android10, the other versions of Android will work fine, it will crash on iOS 14.4 and it will work fine once you upgrade to 15.x. Do I need to configure any additional options on Android10? I've tested, https://github.com/kerryaustin/RNBabylon68, is also the same problem, hope to get quick reply, really appreciate

XiongMeng1992 avatar Aug 26 '22 03:08 XiongMeng1992

I get this if I run it on the emulator:

dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~8uM5mom1SFdYJJXbsiINjg==/com.rnbabylon68-xFzGLKV5YiJzI4AjdZKPEA==/lib/x86/libBabylonNative.so"...

But it works fine on a real device.

bghgary avatar Aug 26 '22 15:08 bghgary

For those that are seeing a crash, please send a call stack with the exception message. Let's make sure we are seeing the same issue.

bghgary avatar Aug 26 '22 23:08 bghgary

Is anyone still seeing this?

thomlucc avatar Sep 29 '22 18:09 thomlucc

Closing, feel free to re-open if needed

thomlucc avatar Oct 04 '22 17:10 thomlucc