Skip to content

Reloading metro server crashes the Android app #483

Closed
@kbhokray

Description

@kbhokray

Describe the bug
Hello, I'm trying to run the sample project on my Android device with react-native 0.69. The app starts fine on initial run, but when I try to reload the Metro server by pressing R, the app crashes with the below error. There is similar issue raised here which seems to have been fixed in a previous release. But I'm getting an error even with the latest @babylonjs/react-native. How can I resolve this ?

To Reproduce

  1. Clone this repo
  2. npm install
  3. Connect an Android device
  4. npm start
  5. npx react-native run-android - The app should get installed and work fine
  6. In the metro tab, press R key - It will break now

Expected behavior
The metro server should reload without crashing.

Other
Device: Xiaomi Redmi Note 11T 5G 21091116AI
Android Version: 11
node: v16.17.0; npm: 8.15.0
Dependencies:

"@babylonjs/core": "5.17.0",
"@babylonjs/loaders": "5.17.0",
"@babylonjs/react-native": "^1.3.5",
"@babylonjs/react-native-iosandroid-0-69": "^1.3.5",
"react": "18.0.0",
"react-native": "0.69.4",
"react-native-permissions": "^3.6.1"

Crash log (truncated):

2022-10-13 15:30:10.264 20560-20667/com.babylonreactnativesample A/actnativesampl: java_vm_ext.cc:577] JNI DETECTED ERROR IN APPLICATION: thread Thread[3,tid=20667,Native,Thread*=0xb4000077186bf800,peer=0x13dc0000,"mqt_js"] using JNIEnv* from thread Thread[33,tid=20623,Runnable,Thread*=0xb400007707778800,peer=0x0,"��"�w
    java_vm_ext.cc:577]     in call to DeleteGlobalRef
    java_vm_ext.cc:577]     from void com.babylonreactnative.BabylonNativeInterop$BabylonNative.initialize(android.content.Context, long, com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder)
2022-10-13 15:30:10.391 20560-20650/com.babylonreactnativesample W/unknown:ReactContextBaseJavaModule: Catalyst Instance has already disappeared: requested by WebSocketModule
2022-10-13 15:30:10.391 20560-20650/com.babylonreactnativesample I/chatty: uid=10366(com.babylonreactnativesample) alhost:8081/... identical 1 line
2022-10-13 15:30:10.391 20560-20650/com.babylonreactnativesample W/unknown:ReactContextBaseJavaModule: Catalyst Instance has already disappeared: requested by WebSocketModule
...
    runtime.cc:655]   native: #12 pc 00000000003722ec  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::(anonymous namespace)::JniValueType*)+612)
    runtime.cc:655]   native: #13 pc 0000000000375820  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::DeleteRef(char const*, _JNIEnv*, _jobject*, art::IndirectRefKind)+676)
    runtime.cc:655]   native: #14 pc 00000000002132bc  /data/app/~~uy3OA17DTM6YCdzjegLAcw==/com.babylonreactnativesample-1otl6jeFKgeV63hT4A3LaA==/lib/arm64/libBabylonNative.so (java::lang::Object::~Object()+64)
    runtime.cc:655]   native: #15 pc 0000000000232990  /data/app/~~uy3OA17DTM6YCdzjegLAcw==/com.babylonreactnativesample-1otl6jeFKgeV63hT4A3LaA==/lib/arm64/libBabylonNative.so (Babylon::Plugins::Camera::Impl::~Impl()+20)
    runtime.cc:655]   native: #16 pc 000000000022923c  /data/app/~~uy3OA17DTM6YCdzjegLAcw==/com.babylonreactnativesample-1otl6jeFKgeV63hT4A3LaA==/lib/arm64/libBabylonNative.so (Babylon::Plugins::NativeVideo::Initialize(Napi::Env&, std::__ndk1::shared_ptr<Babylon::Plugins::Camera::Impl>)+1880)
2022-10-13 15:59:22.395 27746-28008/com.babylonreactnativesample A/actnativesampl: runtime.cc:655]   native: #17 pc 00000000002225b4  /data/app/~~uy3OA17DTM6YCdzjegLAcw==/com.babylonreactnativesample-1otl6jeFKgeV63hT4A3LaA==/lib/arm64/libBabylonNative.so (Babylon::Plugins::Camera::Initialize(Napi::Env, bool)+104)
    runtime.cc:655]   native: #18 pc 0000000000209a70  /data/app/~~uy3OA17DTM6YCdzjegLAcw==/com.babylonreactnativesample-1otl6jeFKgeV63hT4A3LaA==/lib/arm64/libBabylonNative.so (BabylonNative::ReactNativeModule::ReactNativeModule(facebook::jsi::Runtime&, std::__ndk1::function<void (std::__ndk1::function<void ()>)>)+772)
    runtime.cc:655]   native: #19 pc 00000000002096e0  /data/app/~~uy3OA17DTM6YCdzjegLAcw==/com.babylonreactnativesample-1otl6jeFKgeV63hT4A3LaA==/lib/arm64/libBabylonNative.so (std::__ndk1::__compressed_pair_elem<BabylonNative::ReactNativeModule, 1, false>::__compressed_pair_elem<facebook::jsi::Runtime&, std::__ndk1::function<void (std::__ndk1::function<void ()>)>&, 0ul, 1ul>(std::__ndk1::piecewise_construct_t, std::__ndk1::tuple<facebook::jsi::Runtime&, std::__ndk1::function<void (std::__ndk1::function<void ()>)>&>, std::__ndk1::__tuple_indices<0ul, 1ul>)+132)
    runtime.cc:655]   native: #20 pc 00000000002071ac  /data/app/~~uy3OA17DTM6YCdzjegLAcw==/com.babylonreactnativesample-1otl6jeFKgeV63hT4A3LaA==/lib/arm64/libBabylonNative.so (BabylonNative::Initialize(facebook::jsi::Runtime&, std::__ndk1::function<void (std::__ndk1::function<void ()>)>)+236)
    runtime.cc:655]   native: #21 pc 0000000000205e70  /data/app/~~uy3OA17DTM6YCdzjegLAcw==/com.babylonreactnativesample-1otl6jeFKgeV63hT4A3LaA==/lib/arm64/libBabylonNative.so (Java_com_babylonreactnative_BabylonNativeInterop_00024BabylonNative_initialize+164)
...
 
    --------- beginning of crash
2022-10-13 15:30:10.430 20560-20667/com.babylonreactnativesample A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20667 (mqt_js), pid 20560 (actnativesample)

Full log:
babylonreactnativecrash.log

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions