Android: crash when adding a camera to a 3D scene
ivanoikon opened this issue · 4 comments
Requirements:
Please go through this checklist before opening a new issue
- Review the documentation
- Search for existing issues in: ViroCommunity/viro
- Use the latest ViroReact release
Environment
Please provide the following information about your environment:
- Development OS: Mac
- Device OS & Version: Android 14
- Version: same as starter-kit project (2.41.0 and 0.73.3, also in versions 2.20.1+ and 0.73.8)
- Device(s): Google Pixel 7
Description
Starting from a working starter-kit project, change AR controller in order to use a 3D one. Then add a camera to ViroScene. App crashes on startup. If you remove camera then app is fine. Same code works on iOS!
Reproducible Demo
- configure starter-kit project and run on Android. It's ok!
- modify App.tsx with code below. Rerun and app crashes
Modified App.tsx:
[...]
const HelloWorldSceneAR = () => {
const [text, setText] = useState("Initializing AR...");
return (
<ViroScene> **<-- Use ViroScene instead AR one**
<ViroCamera active position={[0, 0, 0]} /> **<-- Add a camera to the scene**
<ViroText
text={text}
scale={[0.5, 0.5, 0.5]}
position={[0, 0, -1]}
style={styles.helloWorldTextStyle}
/>
</ViroScene>
);
};
export default () => {
return (
<Viro3DSceneNavigator **<-- Use 3D scene navigator instead AR**
autofocus={true}
initialScene={{
scene: HelloWorldSceneAR,
}}
style={styles.f1}
/>
);
};
[...]
Crash from Logcat:
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A Cmdline: com.virostarterkit
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A pid: 26586, tid: 26586, name: .virostarterkit >>> com.virostarterkit <<<
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A #2 pc 000000000036ff1c /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!libviro_renderer.so (offset 0x34fd000) (BuildId: 9a84d6989a2bac23d3fdfa4a8e0f90f4c63d1351)
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A #3 pc 000000000036fedc /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!libviro_renderer.so (offset 0x34fd000) (_pabort(char const*, int, char const*, char const*, ...)+84) (BuildId: 9a84d6989a2bac23d3fdfa4a8e0f90f4c63d1351)
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A #4 pc 000000000036fe84 /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!libviro_renderer.so (offset 0x34fd000) (BuildId: 9a84d6989a2bac23d3fdfa4a8e0f90f4c63d1351)
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A #5 pc 000000000036ff30 /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!libviro_renderer.so (offset 0x34fd000) (BuildId: 9a84d6989a2bac23d3fdfa4a8e0f90f4c63d1351)
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A #6 pc 000000000036fedc /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!libviro_renderer.so (offset 0x34fd000) (_pabort(char const*, int, char const*, char const*, ...)+84) (BuildId: 9a84d6989a2bac23d3fdfa4a8e0f90f4c63d1351)
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A #7 pc 0000000000384d1c /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!libviro_renderer.so (offset 0x34fd000) (VROPlatformGetJNIEnv()+168) (BuildId: 9a84d6989a2bac23d3fdfa4a8e0f90f4c63d1351)
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A #8 pc 0000000000362c08 /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!libviro_renderer.so (offset 0x34fd000) (ARUtilsCreateFloatArrayFromMatrix(VROMatrix4f)+20) (BuildId: 9a84d6989a2bac23d3fdfa4a8e0f90f4c63d1351)
2024-05-09 12:12:41.985 26688-26688 DEBUG pid-26688 A #9 pc 00000000002ed0a4 /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!libviro_renderer.so (offset 0x34fd000) (Java_com_viro_core_Node_nativeUpdateAtomicUmbrellaBounds+244) (BuildId: 9a84d6989a2bac23d3fdfa4a8e0f90f4c63d1351)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #16 pc 000000000009ec48 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!classes2.dex] (com.viro.core.Node.updateUmbrellaBounds+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #21 pc 000000000009ec48 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!classes2.dex] (com.viro.core.Node.updateUmbrellaBounds+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #26 pc 000000000009eb98 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!classes2.dex] (com.viro.core.Node.updateUmbrellaBounds+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #31 pc 000000000009eb6c [anon:dalvik-classes2.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!classes2.dex] (com.viro.core.Node.updateAllUmbrellaBounds+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #36 pc 000000000009dcc0 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!classes2.dex] (com.viro.core.Node.addChildNode+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #41 pc 00000000000c1934 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!classes2.dex] (com.viromedia.bridge.component.node.VRTCamera.+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #46 pc 00000000000c1800 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!classes2.dex] (com.viromedia.bridge.component.node.VRTCameraManager.createViewInstance+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #51 pc 00000000000c17e4 [anon:dalvik-classes2.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk!classes2.dex] (com.viromedia.bridge.component.node.VRTCameraManager.createViewInstance+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #56 pc 000000000039a75c [anon:dalvik-classes.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk] (com.facebook.react.uimanager.ViewManager.createViewInstance+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #61 pc 000000000039a72c [anon:dalvik-classes.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk] (com.facebook.react.uimanager.ViewManager.createView+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #67 pc 000000000038b3a0 [anon:dalvik-classes.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk] (com.facebook.react.uimanager.NativeViewHierarchyManager.createView+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #72 pc 0000000000397bf0 [anon:dalvik-classes.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk] (com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #77 pc 0000000000397ea8 [anon:dalvik-classes.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk] (com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #82 pc 0000000000397f8c [anon:dalvik-classes.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk] (com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #87 pc 0000000000386568 [anon:dalvik-classes.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk] (com.facebook.react.uimanager.GuardedFrameCallback.doFrame+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #92 pc 000000000036f18c [anon:dalvik-classes.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk] (com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame+0)
2024-05-09 12:12:41.986 26688-26688 DEBUG pid-26688 A #97 pc 000000000036dd8c [anon:dalvik-classes.dex extracted in memory from /data/app/~~144jMFWwpl0o52Cg0juPWA==/com.virostarterkit-qJbOpc5vA1esC7T2YmbktQ==/base.apk] (com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame+0)
---------------------------- PROCESS ENDED (26586) for package com.virostarterkit ----------------------------
Same behavior using version 2.41.3 on Mac OS 14.4.1 and react native 0.73.8. Any ideas?
Hello @ivanoikon
I am tracking this issue in the native c++ code, but in the meantime, I found this issue dates back to 2019
Please give a look to this old report (with a workaround) while I get this fixed once and for all:
Hello @ivanoikon I am tracking this issue in the native c++ code, but in the meantime, I found this issue dates back to 2019 Please give a look to this old report (with a workaround) while I get this fixed once and for all:
Thank you @doranteseduardo. Using @sanoopks workaround it works properly.