Getting React-Viro Build working on android in windows environment
See original GitHub issueHello, I am new to react-native development.
I have been trying to get a React-Viro project to successfully build onto my mobile S8 android device and have been struggling a lot. I am in a windows 10 environment using git-bash.
First Approach I have been following the steps on the react-viro quickstart website.
react-native init ProjectAR --version0.57.7
cd ViroSample
npm install -S -E react-viro
- copy the files from node_modules\react-viro\bin\files\javascript* to the root
- In App.js assign API Key.
- In index.android.js change to the name of my project
AppRegistry.registerComponent('ProjectAR', () => App);
When I run react-native run-android
I get the error on my phone
Unable to resolve module 'react-native/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType from …\ProjectAR\node_modules\react-viro\components\ViroImage.js
Module ‘react-native/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType’ does not exist in the current Haste module map
Second Approach
npm install -g react-viro-cli
react-viro init NewArProject
cd NewArProject
./setup-ide.sh android
- In App.js assign API Key.
When I run react-native run-android
I get the error in my terminal
FAILURE: Build failed with an exception.
What went wrong: Task ‘installDebug’ not found in project ‘:app’. Some candidates are: ‘installArDebug’, ‘installGvrDebug’, ‘installOvrDebug’.
I go into my android directory and do
./gradlew app:installArDebug
But I get an error
Execution failed for task ‘:app:generateArDebugBuildConfig’.
Please help. Thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (1 by maintainers)
Hi @kolesnikovakate, @jungley, To solve your issue please add the --variant option to the react-native run-android command. If you try the following you should be able to run without error:
Let me know if that doesn’t work for you 😃
try -> react-native init ProjectAR --version0.59.3
We recently upgraded to RN 0.59.3 and this section of the documentation was not updated. It is now corrected