Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: crash when adding a camera to a 3D scene #292

Open
3 tasks done
ivanoikon opened this issue May 9, 2024 · 4 comments
Open
3 tasks done

Android: crash when adding a camera to a 3D scene #292

ivanoikon opened this issue May 9, 2024 · 4 comments
Assignees
Labels
Android Affects google devices running Android

Comments

@ivanoikon
Copy link

Requirements:

Please go through this checklist before opening a new issue

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: Android 14
  3. Version: same as starter-kit project (2.41.0 and 0.73.3, also in versions 2.20.1+ and 0.73.8)
  4. 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 ----------------------------

Copy link

linear bot commented May 9, 2024

@ivanoikon
Copy link
Author

Same behavior using version 2.41.3 on Mac OS 14.4.1 and react native 0.73.8. Any ideas?

@doranteseduardo
Copy link
Member

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:

viromedia/viro#755

@doranteseduardo doranteseduardo self-assigned this Jun 9, 2024
@doranteseduardo doranteseduardo added the Android Affects google devices running Android label Jun 9, 2024
@ivanoikon
Copy link
Author

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:

viromedia/viro#755

Thank you @doranteseduardo. Using @sanoopks workaround it works properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Affects google devices running Android
Projects
None yet
Development

No branches or pull requests

2 participants