Android Emulator NOT supported
ViroReact doesn't currently support the Android Emulator
Have you run through the Prerequisites guide?
Run through steps on the Prerequisites guide before beginning this guide.
If you've completed the Quick Start guide, you should be set up and the HelloWorld project works on the Viro Media App. Your workspace should look similar to the following:
ViroSample/├── App.js├── android├── app.json├── bin├── index.android.js├── index.ios.js├── index.js├── ios├── js├── node_modules├── package.json├── metro.config.js├── rn-cli.config.js├── setup-ide.sh
What each file/directory is for
In a terminal window, navigate to your Viro project root (not Android project root) and run the following:
This will set up the Android project to work with Viro.
For Windows use our Windows Setup Diff file to modify your Android gradle and manifest files.
Android Studio is the IDE (Integrated Developer Environment) used for Android development and we will need it to run and test your Viro React application.
Android Studio requires a recent version of the JDK. If you don't have one installed, install one from here
Download and install Android Studio from here.
Ensure that Android Studio is configured with at least the following:
- Google APIs
- Android SDK Platform 28
- Sources for Android 28
by selecting Custom installation while installing Android Studio or by installing them from the SDK Manager under
Preferences -> Appearance & Behavior -> System Settings -> Android SDK
Building AR/ARCore With Android Studio
Open Android Studio, if you see a welcome screen, select
Open an existing Android Studio project, otherwise open the project with File -> Open.
When the file explorer menu appears navigate to your Project location and open the
Viro currently does not support development with the Android Emulator. You will need to develop with your device to use the Viro platform, at this time.
- Connect your device to your computer via USB. When a pop-up appears asking to "Allow USB Debugging?", select "OK".
- In your terminal, run this command
adb reverse tcp:8081 tcp:8081which will reverse tether your device to your development machine. (Note: the
adbcommand can be found under
platform-toolswherever your sdk is installed, it's recommended that you add this to your environment's $PATH variable.).
- Run 'npm start' from the project root directory to start the package server
- Ensure the target to the left of the green run button is set to "app" and tap on the green run button (see image below).
Run the application and you should see the Hello World scene.
Congratulations, you now have Viro set up and running!
On Android, we support 3 VR Platforms: Google Daydream, Samsung/Oculus GearVR and Google Cardboard. For the Viro Platform however, we only have 2 build flavors:
- GVR - for Google Daydream and Cardboard
- OVR_MOBILE - for Samsung/Oculus GearVR.
One way to toggle between the builds is to expand the
Build Variants panel on the left edge of your Android Studio window and select either
Another way to build your native app is from the command line. Since Viro was built with the goal of working like any other React Native package, you can take advantage of the React Native CLI to build, package and deploy your application to your device.
From the command line, you can run this command with one of the variants from your project's root directory:
react-native run-android --variant=<gvrDebug|ovrDebug>
to build your app for a selected variant.
Check out our Tutorial if you haven't yet gone through it!
Problems with installation? Need extra help? Post your issue here.
Updated over 1 year ago