0% found this document useful (0 votes)
24 views3 pages

Setting Up App On Windows

The document provides instructions for setting up and troubleshooting a React Native project in Android Studio. It includes steps to add environment variables, import the project into Android Studio, configure the project path, and bundle the JavaScript files. It also lists troubleshooting steps to resolve build failures, such as removing and reinstalling node modules, upgrading React Native, and ensuring the correct Gradle dependencies and configuration.

Uploaded by

Daniel Schwartz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

Setting Up App On Windows

The document provides instructions for setting up and troubleshooting a React Native project in Android Studio. It includes steps to add environment variables, import the project into Android Studio, configure the project path, and bundle the JavaScript files. It also lists troubleshooting steps to resolve build failures, such as removing and reinstalling node modules, upgrading React Native, and ensuring the correct Gradle dependencies and configuration.

Uploaded by

Daniel Schwartz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Environment Variables:

Make sure to add this to your Environment Variables

In addition, add this environment variable to already existing ‘Path’

Opening project in Android Studio:


If you have a project open the close it: File>Close Project

Click on the Import Project button on this screen

Make sure the path of the project in Android Studio is:


C:\Users\USERNAME\Documents\GitHub\MyVyB\VyB\android

If it asks you to update Gradle then do so.

Ignore “Unregistered VCS root detected”

If you are using Windows run the commands in the directory


C:\Users\USERNAME\Documents\GitHub\MyVyB\VyB, or if you get an error "Cannot find entry
file index.android.js"

mkdir android\app\src\main\assets

react-native bundle --platform android --dev false --entry-file index.js --


bundle-output android/app/src/main/assets/index.android.bundle --assets-dest
android/app/src/main/res

adb reverse tcp:8081 tcp:8081

From cmd in directory C:\Users\USERNAME\Documents\GitHub\MyVyB\VyB type


react-native start
Troubleshooting issues:

If you encounter an issue where the build fails after pulling from git and
trying to run:

react-native run-android

These steps have resolved the issue:

1. Navigate to: C:\<path to project>\<Project name>\VyB\


2. Remove the folders & files: node_modules, android, ios, package-
lock.json
3. Run: `npm install -g react-native-cli`
4. Run: `react-native upgrade`
5. Run: `mkdir android\app\src\main\assets`
6. Run: `react-native bundle --platform android --dev false --entry-file
index.js --bundle-output
android/app/src/main/assets/index.android.bundle --assets-dest
android/app/src/main/res`
7. Start running AVD
8. Run: `adb reverse tcp:8081 tcp:8081`
9. Run: `react-native link`
10. Open android/app/build.gradle
11. Make sure your gradle dependencies have: implementation
'com.android.support:support-v4:27.1.1'
12. Make sure your gradle config has: multiDexEnabled true
13. Run: `react-native android-start`

You might also like