viro icon indicating copy to clipboard operation
viro copied to clipboard

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

Open vietdung97 opened this issue 1 year ago • 5 comments

  • [ ] Review the documentation: https://docs.viromedia.com/
  • [ ] Search for existing issues: https://github.com/viromedia/viro
  • [ ] Use the latest ViroReact release: https://docs.viromedia.com/docs/releases

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

vietdung97 avatar Sep 11 '23 07:09 vietdung97

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

1hemantbhatt avatar Sep 21 '23 10:09 1hemantbhatt

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..

Buthrakaur avatar Sep 21 '23 14:09 Buthrakaur

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"]}
/>

robertjcolley avatar Jan 31 '24 00:01 robertjcolley

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

robertjcolley avatar Jan 31 '24 00:01 robertjcolley

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"

ssomarii avatar Feb 15 '24 06:02 ssomarii