React Native environment installation stepping notes

Note: I am a front-end, so the node installation tutorial is not listed, and the node environment is also needed, preferably yarn! ! !

jdk installation: select the java1.8.x version, the official download currently requires registration of an oracle account to download, the first download did not pay attention to directly select the latest version that can be downloaded by tourists; note that the official document does not mention the JAVA_HOME environment variable Configuration, which needs to be configured. The address C:\Program Files\Java\jdk1.8.0_281 is the storage address of jdk.

Android Studio installation: the latest version is installed, you need to download the SDK specified version 29.0.2 (specified by the official document), and the official ndk specified is 20.1.5948944. When my project is actually running, it is prompted to install the 20.0.5594570 version, in show Package Choose to download in Details, Android SDK Platfrom-Tools , Android Emulator .

System environment variable configuration:

%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\emulator
%ANDROID_HOME%\tools
%ANDROID_HOME%\tools\bin

Did not download the official Android emulator recommended by Studio, but downloaded a third-party Android emulator (Night God)

The resource download in build.gradle under the Android folder uses the official recommended aliyun download agent address: the
following is the content of running the official dome:

buildscript {
    ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
    }
    repositories {
        google()
        jcenter()
        maven { url 'http://maven.aliyun.com/repository/google' }
        maven { url 'http://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
        maven { url 'http://maven.aliyun.com/repository/google' }
        maven { url 'http://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
    }
}

The download of some of the above resources will be affected by the network. A proxy is used when downloading, and downloading related plug-ins in Android Studio may fail to download. You need to download the plug-ins repeatedly.
Recommend using vpn.

Guess you like

Origin blog.csdn.net/weixin_42512996/article/details/113997121