ReactVision / viro

ViroReact: The AR and VR library for React Native 📳💙💛🤍💚

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native 0.72.4: Invariant Violation: requireNativeComponent: "VRT3DObject" was not found in the UIManager"

vietdung97 opened this issue · comments

Environment

"dependencies": {
    "@viro-community/react-viro": "^2.23.0",
    "react": "18.2.0",
    "react-native": "0.72.4"
  }

Description

Hi Viro team!
I am writing to you today to request that you upgrade your package to be compatible with the latest version of React Native. I am currently trying to run my project, but I am getting the error message "Invariant Violation: requireNativeComponent: "VRT3DObject" was not found in the UIManager".

I believe this error is occurring because the Viro package is not yet compatible with the latest version of React Native. I would be grateful if you could look into this issue and upgrade your package as soon as possible.

Reproducible Demo

My import and usage

import {Viro3DObject} from '@viro-community/react-viro';
<Viro3DObject
    source={require("./res/spaceship.obj")}
    resources={[
        require('./res/spaceship.mtl'),
        require('res/texture1.html'),
        require('res/texture2.html'),
        require('res/texture3.html')
    ]}
    highAccuracyEvents={true}
    position={[1, 3, -5]}
    scale={[2, 2, 2]}
    rotation={[45, 0, 0]}
    type="OBJ"
    transformBehaviors={["billboard"]}
/>

image

The current supported version is 2 years old (0.65.1). Support for the latest react native version would be really helpful.

viro 2.23.0 actually works for us with react native 0.71.3 including the Viro3DObject component so this may be some linking issue..

Hi @vietdung97 ,

I noticed you have some issues with your paths in the example code you provided. Can you try updating your Viro3DObject to look like this?

I noticed that you have some .html textures and you're using requires without the ./res.

<Viro3DObject
    source={require("./res/spaceship.obj")}
    resources={[
        require('./res/spaceship.mtl'),
        require('./res/texture1.mtl'),                          // was: 'res/texture1.html'
        require('./res/texture2.mtl'), 
        require('./res/texture3.mtl')
    ]}
    highAccuracyEvents={true}
    position={[1, 3, -5]}
    scale={[2, 2, 2]}
    rotation={[45, 0, 0]}
    type="OBJ"
    transformBehaviors={["billboard"]}
/>

Can you also include if this is on Android or iOS?

Hello!
I have the same problem with a little different pull of dependencies than author of the issue has:

   "dependencies": {
     "@viro-community/react-viro": "^2.23.3",
     "react": "18.2.0",
     "react-native": "0.73.3"
   },

Trying to open "starter-kit" project on Android. App.tsx without any changes.

Error: "Invariant Violation: requireNativeComponent: "VRTText" was not found in the UIManager"