It takes 3 hours to get the environment ready, all the steps and focal points are listed here.
Step 1 : Install basic environment
2. Java JDK
3. Android SDK
Step 2 : Define Environment Variables
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_77 (JDK Path)
tips: remember to use ‘java -version’ and ‘java’ to test whether java environment is ok.
ANDROID_HOME : C:\Users\Cyrus_Cai\AppData\Local\Android\sdk (Android SDK path)
Step 3 : Configure SDK
- Find Android manager ( Android SDK path)
- Make sure that the listed items are selected:
- Android SDK Build-tools version 23.0.1
- Android 6.0 (API 23)
- Local Maven repository for Support Libraries (this is called Android Support Repository in older versions)
Step 4 : Install Genymotion
Genymotion: an emulators which is easier to set up than stock. More research is needed on Genymotion actually.
We can get Genymotion here
1. down individual version( it’s free)
2. VirtualBox is needed to set up Genymotion, if we haven’t installed it, we can download a with virtualBox version.
3. After installing Genymotion and virtualBox, remember to add a new virtual device and try to run it. This will help us to test whether android platform is ready or not (I guess).
Step 5 : Use gradle deamon
React Native Android use gradle as a build system. It is recommend to enable gradle daemon functionality which may result in up to 50% improvement in incremental build times for changes in java code.
how to : copy this command and run it in ‘command line’
(if not exist “%USERPROFILE%/.gradle” mkdir “%USERPROFILE%/.gradle”) && (echo org.gradle.daemon=true >> “%USERPROFILE%/.gradle/gradle.properties”)