ReactVision / viro

ViroReact: The AR and VR library for React Native 📳💙💛🤍💚
MIT License
1.3k stars 150 forks source link

TypeError: Cannot read property 'setJSMaterials' of null on Android using Expo #282

Open ManuSense opened 3 months ago

ManuSense commented 3 months ago

I am using expo and I just followed the installation guide with expo: https://viro-community.readme.io/docs/integrating-with-expo. Android build went fine but at runtime i got this error:

TypeError: Cannot read property 'setJSMaterials' of null, js engine: hermes C:\...\Material\ViroMaterials.js etc...

Any idea how to solve it?

Other info: "@viro-community/react-viro": "^2.41.1" "expo": "~50.0.4" "react": "18.2.0" "react-native": "0.73.2"

linear[bot] commented 3 months ago

XR-192 TypeError: Cannot read property 'setJSMaterials' of null on Android using Expo

thekevinbrown commented 2 months ago

I'm seeing the same on iOS.

nab138 commented 2 months ago

I'm also seeing the same on ios

LimitedDani commented 2 months ago

I'm seeing the same

thekevinbrown commented 1 month ago

I fixed this by following the instructions here: https://viro-community.readme.io/docs/integrating-with-expo

Summation of Findings

  1. The error effectively means, "Viro cannot load its native code".
  2. To get it to load its native code, you need to link / build it in, which you do with the expo prebuild command, then running it that way.
  3. This means you can't use Expo Go.
  4. Should fix it for you!