BabylonReactNative: App crashes on launch
Describe the bug When I use useEngine hook, application immediately crashes on the start. No errors except few warnings about require cycles which is caused by babylon react native. I don’t think them as the cause of the crash. My RN version is 0.66.1 (also tried with 0.64.0 same result). Enabling Hermes didn’t help neither.
To Reproduce Steps to reproduce the behavior:
- npx react-native init MyApp --template react-native-template-typescript
- npm i @babylonjs/react-native
- npm i @babylonjs/core@5.0.0-alpha.50
- npm i react-native-permissions
- Configure react-native-permissions
- Paste the code below to the App.tsx file: (Exact code is not necessarily required. The line
const engine = useEngine()
is enough for crash to occur. )
import { useEngine, EngineView } from '@babylonjs/react-native';
import { Engine, Scene, Camera } from '@babylonjs/core';
const MyComponent: FunctionComponent<MyComponentProps> = (props: MyComponentProps) => {
const engine = useEngine();
const [camera, setCamera] = useState<Camera>();
useEffect(() => {
if (engine) {
const scene = new Scene(engine);
scene.createDefaultCamera(true);
setCamera(scene.activeCamera!);
// Setup the scene!
}
}, [engine]);
return (
<>
<EngineView style={{flex: 1}} camera={camera} />
</>
);
}
- npx react-native run-android (yarn android)
Expected behavior App expected to work and init a Babylonjs scene instance. Instead it crashes with A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 8098 (com.bbrnative), pid 8098 (com.bbrnative).
LOGCAT:
2021-10-18 22:24:27.597 8098-8175/com.bbrnative I/com.bbrnative: The ClassLoaderContext is a special shared library.
2021-10-18 22:24:28.562 8098-8175/com.bbrnative I/cr_LibraryLoader: Time to load native libraries: 21 ms (timestamps 4851-4872)
2021-10-18 22:24:28.723 8098-8175/com.bbrnative I/chromium: [INFO:library_loader_hooks.cc(50)] Chromium logging enabled: level = 0, default verbosity = 0
2021-10-18 22:24:28.725 8098-8175/com.bbrnative I/cr_LibraryLoader: Expected native library version number "74.0.3729.185", actual native library version number "74.0.3729.185"
2021-10-18 22:24:28.932 8098-8174/com.bbrnative I/ReactNativeJS: Running "bbrnative" with {"rootTag":1}
2021-10-18 22:24:29.307 8098-8174/com.bbrnative W/ReactNativeJS: 'Require cycle: node_modules\\@babylonjs\\core\\scene.js -> node_modules\\@babylonjs\\core\\scene.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.', '\nMyComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:108280:90\nRCTView\nView\nRCTView\nView\nAppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:76247:36'
2021-10-18 22:24:29.544 8098-8174/com.bbrnative I/chatty: uid=10136(com.bbrnative) mqt_js identical 19 lines
2021-10-18 22:24:29.557 8098-8174/com.bbrnative W/ReactNativeJS: 'Require cycle: node_modules\\@babylonjs\\core\\scene.js -> node_modules\\@babylonjs\\core\\scene.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.', '\nMyComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:108280:90\nRCTView\nView\nRCTView\nView\nAppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:76247:36'
2021-10-18 22:24:29.841 8098-8174/com.bbrnative W/ReactNativeJS: 'Require cycle: node_modules\\@babylonjs\\core\\Meshes\\mesh.js -> node_modules\\@babylonjs\\core\\Meshes\\mesh.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.', '\nMyComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:108280:90\nRCTView\nView\nRCTView\nView\nAppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:76247:36'
2021-10-18 22:24:29.857 8098-8174/com.bbrnative W/ReactNativeJS: 'Require cycle: node_modules\\@babylonjs\\core\\Meshes\\mesh.js -> node_modules\\@babylonjs\\core\\Meshes\\mesh.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.', '\nMyComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:108280:90\nRCTView\nView\nRCTView\nView\nAppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:76247:36'
2021-10-18 22:24:29.887 8098-8174/com.bbrnative I/chatty: uid=10136(com.bbrnative) mqt_js identical 2 lines
2021-10-18 22:24:29.899 8098-8174/com.bbrnative W/ReactNativeJS: 'Require cycle: node_modules\\@babylonjs\\core\\Meshes\\mesh.js -> node_modules\\@babylonjs\\core\\Meshes\\mesh.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.', '\nMyComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:108280:90\nRCTView\nView\nRCTView\nView\nAppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:76247:36'
2021-10-18 22:24:29.925 8098-8174/com.bbrnative W/ReactNativeJS: 'Require cycle: node_modules\\@babylonjs\\core\\Meshes\\mesh.js -> node_modules\\@babylonjs\\core\\Meshes\\mesh.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.', '\nMyComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:108280:90\nRCTView\nView\nRCTView\nView\nAppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:76247:36'
2021-10-18 22:24:30.416 8098-8174/com.bbrnative I/chatty: uid=10136(com.bbrnative) mqt_js identical 28 lines
2021-10-18 22:24:30.423 8098-8174/com.bbrnative W/ReactNativeJS: 'Require cycle: node_modules\\@babylonjs\\core\\Meshes\\mesh.js -> node_modules\\@babylonjs\\core\\Meshes\\mesh.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.', '\nMyComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:108280:90\nRCTView\nView\nRCTView\nView\nAppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:76247:36'
2021-10-18 22:24:31.118 8098-8174/com.bbrnative W/ReactNativeJS: 'Require cycle: node_modules\\@babylonjs\\core\\Misc\\fileTools.js -> node_modules\\@babylonjs\\core\\Misc\\fileTools.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.', '\nMyComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:108280:90\nRCTView\nView\nRCTView\nView\nAppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:76247:36'
2021-10-18 22:24:31.305 8098-8174/com.bbrnative I/chatty: uid=10136(com.bbrnative) mqt_js identical 11 lines
2021-10-18 22:24:31.312 8098-8174/com.bbrnative W/ReactNativeJS: 'Require cycle: node_modules\\@babylonjs\\core\\Misc\\fileTools.js -> node_modules\\@babylonjs\\core\\Misc\\fileTools.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.', '\nMyComponent@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:108280:90\nRCTView\nView\nRCTView\nView\nAppContainer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.bbrnative&modulesOnly=false&runModule=true:76247:36'
2021-10-18 22:24:33.271 8098-8098/com.bbrnative W/com.bbrnative: Accessing hidden field Landroid/view/View;->mAccessibilityDelegate:Landroid/view/View$AccessibilityDelegate; (greylist, reflection, allowed)
2021-10-18 22:24:37.057 8098-8174/com.bbrnative D/SoLoader: About to load: libturbomodulejsijni.so
2021-10-18 22:24:37.058 8098-8174/com.bbrnative D/SoLoader: libturbomodulejsijni.so not found on /data/data/com.bbrnative/lib-main
2021-10-18 22:24:37.061 8098-8174/com.bbrnative D/SoLoader: libturbomodulejsijni.so found on /data/app/com.bbrnative-vO5i0Go6NPIP4z1KNHH1fw==/lib/x86
2021-10-18 22:24:37.061 8098-8174/com.bbrnative D/SoLoader: Not resolving dependencies for libturbomodulejsijni.so
2021-10-18 22:24:37.319 8098-8174/com.bbrnative D/SoLoader: Loaded: libturbomodulejsijni.so
2021-10-18 22:24:37.720 8098-8147/com.bbrnative D/EGL_emulation: eglMakeCurrent: 0xebe7fa60: ver 2 0 (tinfo 0xebec0f80)
2021-10-18 22:24:37.732 8098-8098/com.bbrnative I/Choreographer: Skipped 35 frames! The application may be doing too much work on its main thread.
2021-10-18 22:24:37.933 8098-8111/com.bbrnative I/com.bbrnative: Background young concurrent copying GC freed 28267(5064KB) AllocSpace objects, 2(48KB) LOS objects, 25% free, 14MB/19MB, paused 2.891ms total 546.275ms
2021-10-18 22:24:38.209 8098-8199/com.bbrnative D/SoLoader: About to load: libimagepipeline.so
2021-10-18 22:24:38.210 8098-8199/com.bbrnative D/SoLoader: libimagepipeline.so not found on /data/data/com.bbrnative/lib-main
2021-10-18 22:24:38.210 8098-8199/com.bbrnative D/SoLoader: libimagepipeline.so found on /data/app/com.bbrnative-vO5i0Go6NPIP4z1KNHH1fw==/lib/x86
2021-10-18 22:24:38.211 8098-8199/com.bbrnative D/SoLoader: Not resolving dependencies for libimagepipeline.so
2021-10-18 22:24:38.241 8098-8147/com.bbrnative I/OpenGLRenderer: Davey! duration=1205ms; Flags=0, IntendedVsync=2943202594541, Vsync=2943202594541, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=2943205809980, AnimationStart=2943205962080, PerformTraversalsStart=2943723067980, DrawStart=2943735408280, SyncQueued=2943894623580, SyncStart=2944039453380, IssueDrawCommandsStart=2944039892280, SwapBuffers=2944217565080, FrameCompleted=2944552842680, DequeueBufferDuration=8383000, QueueBufferDuration=4265000,
2021-10-18 22:24:38.350 8098-8199/com.bbrnative D/SoLoader: Loaded: libimagepipeline.so
2021-10-18 22:24:38.665 8098-8098/com.bbrnative D/HostConnection: HostConnection::get() New Host Connection established 0xc1223ca0, tid 8098
2021-10-18 22:24:38.673 8098-8098/com.bbrnative D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2
2021-10-18 22:24:38.677 8098-8098/com.bbrnative A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 8098 (com.bbrnative), pid 8098 (com.bbrnative)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 37 (16 by maintainers)
As a test can you try downgrading @babylonjs/react-native to version 0.4.0-alpha.35 and @babylonjs/core to version 5.0.0-alpha.47?