viro icon indicating copy to clipboard operation
viro copied to clipboard

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

Open ManuSense opened this issue 5 months ago • 5 comments

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"

ManuSense avatar Mar 15 '24 15:03 ManuSense

I'm seeing the same on iOS.

thekevinbrown avatar May 01 '24 06:05 thekevinbrown

I'm also seeing the same on ios

nab138 avatar May 02 '24 23:05 nab138

I'm seeing the same

LimitedDani avatar May 03 '24 18:05 LimitedDani

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!

thekevinbrown avatar May 06 '24 05:05 thekevinbrown