viromedia / viro

ViroReact: AR and VR using React Native
MIT License
2.31k stars 483 forks source link

iOs Crash when mounting ViroVRSceneNavigator after mounting ViroARSceneNavigator #814

Open beauvaisbruno opened 4 years ago

beauvaisbruno commented 4 years ago

Description

Crash when mounting ViroVRSceneNavigator after mounting ViroARSceneNavigator. It is not crashing if there is no Viro3DModel loaded. Tested with OBJ and GLB.

Reproducible Demo

import {
  ViroARScene,
  ViroARSceneNavigator,
  ViroScene,
  ViroVRSceneNavigator,
  Viro3DObject,
  ViroAmbientLight
} from "react-viro";

import React, { useState } from "react";
import { AppRegistry, View } from "react-native";
import { useEffect } from "react";

const App = () => {
  const [showVR, setShowVR] = useState(false);

  useEffect(() => {
    setTimeout(() => {
      setShowVR(true);
    }, 1000);
  }, []);

  if (showVR)
    return (
      <View style={{ flex: 1}}>
        <ViroVRSceneNavigator
          vrModeEnabled={false}
          initialScene={{
            scene: () => {
              return (
                <ViroScene>
                  <ViroAmbientLight color={"#aaaaaa"} />
                  <Viro3DObject
                    source={require("./sphere.obj")}
                    type="OBJ"
                    position={[0, 0, 0]}
                  />
                </ViroScene>
              );
            }
          }}
        />
      </View>
    );
  return (
    <View style={{ flex: 1 }}>
      <ViroARSceneNavigator
        initialScene={{
          scene: () => (
            <ViroARScene>
              <ViroAmbientLight color={"#aaaaaa"} />
              <Viro3DObject
                source={require("./sphere.obj")}
                type="OBJ"
                position={[0, 0, 0]}
              />
            </ViroARScene>
          )
        }}
      />
    </View>
  );
};

AppRegistry.registerComponent("appname", () => App);

LOG

Error in gleRunVertexSubmitARM Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

objc[466]: Class GTMSessionFetcher is implemented in both /private/var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/Frameworks/ViroKit_static_lib.framework/ViroKit_static_lib (0x102965380) and /var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/geneva (0x101513b90). One of the two will be used. Which one is undefined.
objc[466]: Class GTMSessionCookieStorage is implemented in both /private/var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/Frameworks/ViroKit_static_lib.framework/ViroKit_static_lib (0x1029653a8) and /var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/geneva (0x101513be0). One of the two will be used. Which one is undefined.
objc[466]: Class GTMSessionFetcherService is implemented in both /private/var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/Frameworks/ViroKit_static_lib.framework/ViroKit_static_lib (0x102965420) and /var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/geneva (0x101513c80). One of the two will be used. Which one is undefined.
objc[466]: Class GTMSessionFetcherSessionDelegateDispatcher is implemented in both /private/var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/Frameworks/ViroKit_static_lib.framework/ViroKit_static_lib (0x102965448) and /var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/geneva (0x101513ca8). One of the two will be used. Which one is undefined.
objc[466]: Class GTMSessionUploadFetcher is implemented in both /private/var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/Frameworks/ViroKit_static_lib.framework/ViroKit_static_lib (0x1029654c0) and /var/containers/Bundle/Application/F840CE4B-508D-4758-B133-BDC33D1027BD/geneva.app/geneva (0x101513d20). One of the two will be used. Which one is undefined.
2020-01-23 03:52:10.108682-0800 geneva[466:54680]  - <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2020-01-23 03:52:10.244724-0800 geneva[466:54647] -[RNFirebaseNotifications init] [Line 46] Setting up RNFirebaseNotifications instance
2020-01-23 03:52:10.306259-0800 geneva[466:54693] 6.3.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
2020-01-23 03:52:10.309728-0800 geneva[466:54693] 6.3.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60002000 started
2020-01-23 03:52:10.309776-0800 geneva[466:54693] 6.3.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2020-01-23 03:52:10.328 [info][tid:main][RCTCxxBridge.mm:213] Initializing <RCTCxxBridge: 0x103119140> (parent: <RCTBridge: 0x283e39ce0>, executor: (null))
2020-01-23 03:52:10.328914-0800 geneva[466:54647] Initializing <RCTCxxBridge: 0x103119140> (parent: <RCTBridge: 0x283e39ce0>, executor: (null))
2020-01-23 03:52:10.362 [info][tid:main][RCTBridge.m:134] Class RNFaceDetectorModuleMLKit was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2020-01-23 03:52:10.362136-0800 geneva[466:54647] Class RNFaceDetectorModuleMLKit was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2020-01-23 03:52:10.401 [info][tid:main][RCTRootView.m:293] Running application geneva ({
    initialProps =     {
    };
    rootTag = 1;
})
2020-01-23 03:52:10.401066-0800 geneva[466:54647] Running application geneva ({
    initialProps =     {
    };
    rootTag = 1;
})
2020-01-23 03:52:10.410869-0800 geneva[466:54647] -[RNFirebaseMessaging init] [Line 33] Setting up RNFirebaseMessaging instance
2020-01-23 03:52:10.410963-0800 geneva[466:54647] -[RNFirebase init] [Line 18] Setting up RNFirebase instance
2020-01-23 03:52:10.411036-0800 geneva[466:54647] -[RNFirebaseNotifications init] [Line 46] Setting up RNFirebaseNotifications instance
2020-01-23 03:52:10.423551-0800 geneva[466:54647] -[RNFirebaseMessaging messaging:didReceiveRegistrationToken:] [Line 86] Received new FCM token: e8ihdkrPbfE:APA91bGM2utJ21-xHHvo7ovUY-mGxn0pV6lqYVm1g-nMFK75Hygf1mpSTWuTY2rSX6CvzTyP20LDHXTNUmEDGBu9Ib1CBhaj1Jm_wNYrkvIPLys6q3ax9LHvQhd-XX5wgq_ThiX9iWUy
2020-01-23 03:52:10.489678-0800 geneva[466:54694] [] nw_socket_handle_socket_event [C4.1:1] Socket SO_ERROR [61: Connection refused]
2020-01-23 03:52:10.490661-0800 geneva[466:54694] [] nw_socket_handle_socket_event [C4.2:1] Socket SO_ERROR [61: Connection refused]
2020-01-23 03:52:10.490850-0800 geneva[466:54684] [] nw_connection_get_connected_socket [C4] Client called nw_connection_get_connected_socket on unconnected nw_connection
2020-01-23 03:52:10.490867-0800 geneva[466:54684] TCP Conn 0x282038e40 Failed : error 0:61 [61]
2020-01-23 03:52:10.549 [warn][tid:main][RCTEventEmitter.m:53] Sending `batteryChanged` with no listeners registered.
2020-01-23 03:52:10.549126-0800 geneva[466:54647] Sending `batteryChanged` with no listeners registered.
2020-01-23 03:52:10.577297-0800 geneva[466:54693] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2020-01-23 03:52:10.577849-0800 geneva[466:54693] [MC] Reading from public effective user settings.
2020-01-23 03:52:10.628820-0800 geneva[466:54689] [] nw_socket_handle_socket_event [C5:1] Socket SO_ERROR [61: Connection refused]
2020-01-23 03:52:10.629151-0800 geneva[466:54694] [] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection
2020-01-23 03:52:10.629214-0800 geneva[466:54694] TCP Conn 0x282032640 Failed : error 0:61 [61]
2020-01-23 03:52:10.765814-0800 geneva[466:54694] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x1031184e0] get output frames failed, state 8196
2020-01-23 03:52:10.765964-0800 geneva[466:54694] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x1031184e0] get output frames failed, state 8196
2020-01-23 03:52:10.766273-0800 geneva[466:54694] TIC Read Status [1:0x0]: 1:57
2020-01-23 03:52:10.766297-0800 geneva[466:54694] TIC Read Status [1:0x0]: 1:57
2020-01-23 03:52:11.460 [info][tid:com.facebook.react.JavaScript] Running application "geneva" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2020-01-23 03:52:11.460205-0800 geneva[466:54697] Running application "geneva" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2020-01-23 03:52:11.788768-0800 geneva[466:54647] "Preferred FPS 30"
2020-01-23 03:52:11.794745-0800 geneva[466:54647] DOF6 tracking configuration
2020-01-23 03:52:11.810981-0800 geneva[466:54688] [] nw_socket_handle_socket_event [C7:1] Socket SO_ERROR [61: Connection refused]
2020-01-23 03:52:11.811230-0800 geneva[466:54694] [] nw_connection_get_connected_socket [C7] Client called nw_connection_get_connected_socket on unconnected nw_connection
2020-01-23 03:52:11.811246-0800 geneva[466:54694] TCP Conn 0x28203b000 Failed : error 0:61 [61]
2020-01-23 03:52:11.903225-0800 geneva[466:54647] "GPU vendor [Apple Inc.], renderer [Apple A10 GPU]"
2020-01-23 03:52:11.903287-0800 geneva[466:54647] "Creating render targets with configuration:"
2020-01-23 03:52:11.903301-0800 geneva[466:54647] "[MRT supported:   1]"
2020-01-23 03:52:11.903313-0800 geneva[466:54647] "[Shadows enabled: 1]"
2020-01-23 03:52:11.903324-0800 geneva[466:54647] "[HDR supported:   1, HDR enabled:   1]"
2020-01-23 03:52:11.903334-0800 geneva[466:54647] "[PBR supported:   1, PBR enabled:   1]"
2020-01-23 03:52:11.903344-0800 geneva[466:54647] "[Bloom supported: 1, Bloom enabled: 1]"
2020-01-23 03:52:11.905098-0800 geneva[466:54647] "Realized font [name: Helvetica-Light, family: Helvetica] for requested family [Helvetica]"
2020-01-23 03:52:11.907607-0800 geneva[466:54647] "No gamma correction enabled in tone-mapper"
2020-01-23 03:52:11.953662-0800 geneva[466:54689] "Loading OBJ from file /private/var/mobile/Containers/Data/Application/6E2073DE-1B73-4352-9AA0-48E9571F8BDB/tmp/3601FD71-D18E-4F37-9C17-E0D5840DAE47-466-000000499C599799_sphere.obj?platform=ios&hash=611563dfe14dd0a41229ed9acc81ae4c"
2020-01-23 03:52:11.953862-0800 geneva[466:54689] "   Queued reading of material file [sphere.mtl]"
2020-01-23 03:52:11.953956-0800 geneva[466:54689] "   MTL files queued for reading"
2020-01-23 03:52:11.953980-0800 geneva[466:54647] "   Reading MTL files (if any)..."
2020-01-23 03:52:11.983533-0800 geneva[466:54647] "   MTL files read, loading OBJ"
2020-01-23 03:52:11.983734-0800 geneva[466:54647] "OBJ # of vertices  = 240"
2020-01-23 03:52:11.983746-0800 geneva[466:54647] "OBJ # of normals   = 80"
2020-01-23 03:52:11.983755-0800 geneva[466:54647] "OBJ # of texcoords = 0"
2020-01-23 03:52:11.983763-0800 geneva[466:54647] "OBJ # of materials = 1"
2020-01-23 03:52:11.983771-0800 geneva[466:54647] "OBJ # of shapes    = 1"
2020-01-23 03:52:11.983833-0800 geneva[466:54647] "OBJ bounding box    =  x(-0.212683 0.212683) y(-0.223628 0.223628) z(-0.656366 -0.209110)"
2020-01-23 03:52:12.495374-0800 geneva[466:54680] [] nw_socket_handle_socket_event [C10.1:1] Socket SO_ERROR [61: Connection refused]
2020-01-23 03:52:12.495938-0800 geneva[466:54680] [] nw_socket_handle_socket_event [C10.2:1] Socket SO_ERROR [61: Connection refused]
2020-01-23 03:52:12.496095-0800 geneva[466:54694] [] nw_connection_get_connected_socket [C10] Client called nw_connection_get_connected_socket on unconnected nw_connection
2020-01-23 03:52:12.496114-0800 geneva[466:54694] TCP Conn 0x282028a80 Failed : error 0:61 [61]
2020-01-23 03:52:12.533496-0800 geneva[466:54647] [framework] CUIThemeStore: No theme registered with id=0
2020-01-23 03:52:12.722736-0800 geneva[466:54647] "Initializing GVR renderer with bounds (375.000000, 667.000000)"
2020-01-23 03:52:12.724064-0800 geneva[466:54647] INFO [vr/gvr/capi/src/gvr.cc:116] Initialized GVR version 1.120.0
2020-01-23 03:52:12.750658-0800 geneva[466:54647] INFO [vr/gvr/hmd/cardboard/cardboard_api_impl.cc:451] Creating swap chain with id: [1]
2020-01-23 03:52:12.750723-0800 geneva[466:54647] INFO [vr/gvr/hmd/cardboard/cardboard_api_impl.cc:455]   BufferSpec 0: Size=V[750, 1334], ColorFormat=Rgba8888, DepthFormat=RenderbufferDepth24Stencil8, Samples=0, Views=1
2020-01-23 03:52:12.750760-0800 geneva[466:54647] INFO [vr/gvr/hmd/cardboard/cardboard_api_impl.cc:455]   BufferSpec 1: Size=V[750, 1334], ColorFormat=Rgba8888, DepthFormat=<UNKNOWN>, Samples=0, Views=1
2020-01-23 03:52:12.941640-0800 geneva[466:54680] "Loading OBJ from file /private/var/mobile/Containers/Data/Application/6E2073DE-1B73-4352-9AA0-48E9571F8BDB/tmp/AE137794-ABEB-481C-ADC8-12DF08E6360B-466-000000499D977040_sphere.obj?platform=ios&hash=611563dfe14dd0a41229ed9acc81ae4c"
2020-01-23 03:52:12.941829-0800 geneva[466:54680] "   Queued reading of material file [sphere.mtl]"
2020-01-23 03:52:12.941936-0800 geneva[466:54680] "   MTL files queued for reading"
2020-01-23 03:52:12.942263-0800 geneva[466:54647] "   Reading MTL files (if any)..."
2020-01-23 03:52:12.944123-0800 geneva[466:54647] "GPU vendor [Apple Inc.], renderer [Apple A10 GPU]"
2020-01-23 03:52:12.944159-0800 geneva[466:54647] "Creating render targets with configuration:"
2020-01-23 03:52:12.944171-0800 geneva[466:54647] "[MRT supported:   1]"
2020-01-23 03:52:12.944182-0800 geneva[466:54647] "[Shadows enabled: 1]"
2020-01-23 03:52:12.944192-0800 geneva[466:54647] "[HDR supported:   1, HDR enabled:   1]"
2020-01-23 03:52:12.944202-0800 geneva[466:54647] "[PBR supported:   1, PBR enabled:   1]"
2020-01-23 03:52:12.944596-0800 geneva[466:54647] "[Bloom supported: 1, Bloom enabled: 1]"
2020-01-23 03:52:12.945535-0800 geneva[466:54647] "Realized font [name: Helvetica-Light, family: Helvetica] for requested family [Helvetica]"
2020-01-23 03:52:12.947472-0800 geneva[466:54647] "No gamma correction enabled in tone-mapper"
2020-01-23 03:52:13.010922-0800 geneva[466:54647] "   MTL files read, loading OBJ"
2020-01-23 03:52:13.011146-0800 geneva[466:54647] "OBJ # of vertices  = 240"
2020-01-23 03:52:13.011159-0800 geneva[466:54647] "OBJ # of normals   = 80"
2020-01-23 03:52:13.011168-0800 geneva[466:54647] "OBJ # of texcoords = 0"
2020-01-23 03:52:13.011176-0800 geneva[466:54647] "OBJ # of materials = 1"
2020-01-23 03:52:13.011184-0800 geneva[466:54647] "OBJ # of shapes    = 1"
2020-01-23 03:52:13.011242-0800 geneva[466:54647] "OBJ bounding box    =  x(-0.212683 0.212683) y(-0.223628 0.223628) z(-0.656366 -0.209110)"
beauvaisbruno commented 4 years ago

Is it possible to use the ViroARSceneNavigator and the ViroVRSceneNavigator in the same iOS application? We are developing an application with mixed content: AR scene and 3D scene where the user examines the elements. Note that it works on Android.