Hi,
I keep getting this error in my ios app, not really sure how to resolve it:
Cannot read property 'setJSMaterials' of undefined
Function.createMaterials
ViroMaterials.js:71:20
<unknown>
HelloWorldSceneAR.js:68:14
loadModuleImplementation
require.js:214:4
guardedLoadModule
require.js:148:11
_require
require.js:132:2
<unknown>
App.js:33:21
loadModuleImplementation
require.js:214:4
guardedLoadModule
require.js:148:11
_require
require.js:132:2
<unknown>
index.js:2
Any help would be appreciated.
Thanks
HI @ChibiMora,
What version of react-viro are you using? Are you running on Android using Android Studio or on iOS with XCode? Or are you getting this error using the Viro Testbed App? Usually this can occur if react-viro wasn't installed properly on your project and the native modules can't be found.
i have the same problem, after install react viro in react cli
@reyapr can we get more info from you to repro this issue. What version of react-viro are you using? Are you running on Android using Android Studio or on iOS with XCode? Or are you getting this error using the Viro Testbed App? Usually this can occur if react-viro wasn't installed properly on your project and the native modules can't be found.
i'm running Android with react native cli
react-viro 2.7.3
Hi @reyapr, for a new project you should install viro with the react-viro cli as our cli does some setup steps to ensure viro will build properly. And with react-viro cli you can run a setup-ide script that modifies the gradle files for android to ensure the project builds correctly.
What command did you run to install the react-viro package? If you are installing to an existing project you'll need to follow these steps here:
https://docs.viromedia.com/docs/integrating-existing-projects-android
Let me know if that helps or you need more info. Thanks :)
Hi,
I'm also getting this issue. I'm trying to run sample project, it works fine with testbed app but giving error while trying to run on iOS device with xCode.
xCode version : 9.4.1
iOS: 11.4
Please let me know how to solve this issue. Testbed app takes too much time to load and its adding delays in development .

Hi @faisal3413,
1) Did you create your project running 'react-viro init'??
2) Did you run the script './setup-ide --all' in your project directory?
3) If you did 2), what was the output of that script, can you cut and paste that here?
4) Did you modify the sample code in anyway?
Thanks!
Hi @VikAdvani,
Sorry for delayed response as I was using testbed app to continue development.
I missed to run the script './setup-ide.sh --all'
I tried again and followed the guide to setup viro with xcode and I got it working successfully.
Any one coming to this thread should follow the guide below and hopefully things will turn around.
https://docs.viromedia.com/docs/starting-a-new-viro-project-1
Library is very good, keep the great work up !
Thanks
If you still get some build errors after following the guide, make sure you open the xcworkspace instead of xcodeproj as viro react is using coca pods.
Most helpful comment
If you still get some build errors after following the guide, make sure you open the xcworkspace instead of xcodeproj as viro react is using coca pods.