(1)
Installation: NPM install-g REACT-NATIVE-CLI
REACT-NATIVE-CLI is a command-line tool for developing react native
The above line of code will help you install the react-native command in terminal. Of course, you only need to run this line of code once.
(2)
The react-native command line has trouble dragging code from NPM's official source for well-known network reasons. Please replace the NPM repository source with a domestic mirror:
set registry https://registry.npm.taobao.org --globalnpm config set disturl https://npm.taobao.org/dist --global
Also, remember to precede the init with 不要
sudo (otherwise the directory owner of the new project becomes root instead of the current user, causing a series of permissions problems, use Chown fix).
(3) withreact-native init AwesomeProject 出现不成功,类似的“
Uncaught Error: EPERM: operation not permitted,” 表示的 权限错误
Add an as administerator to the back.
(4)
npm install --save [email protected] 最后一个版本;node 升级
(5)
1, the key that generated the signature
This process will be used keytool
, the development of Android should have been exposed to the thing. See Key and certificate management tools for details.
Execute in the main directory of the project:
keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000[注:在产生的时候需要提供密钥和存储密码,后续会用到]mv my-release-key.keystore android/app/
2, modify
android/gradle.properties
File, add the following
MYAPP_RELEASE_STORE_FILE=my-release-key.keystoreMYAPP_RELEASE_KEY_ALIAS=my-key-aliasMYAPP_RELEASE_STORE_PASSWORD=xxMYAPP_RELEASE_KEY_PASSWORD=xx[注意替换xx为你自己设置的密钥和存储密码]
3, modify
android/app/build.gradle
Signature configuration in the file:
...android { ... defaultConfig { ... } signingConfigs { release { storeFile file(MYAPP_RELEASE_STORE_FILE) storePassword MYAPP_RELEASE_STORE_PASSWORD keyAlias MYAPP_RELEASE_KEY_ALIAS keyPassword MYAPP_RELEASE_KEY_PASSWORD } } buildTypes { release { ... signingConfig signingConfigs.release } }}
4, then go to Android directory to do the following:
./gradlew assembleRelease
will be at the end android/app/build/outputs/apk/app-release.apk
.
Before each execution, be careful to delete the apk.
Failed to read key from KeyStore This problem, is because the configuration of the wrong, fuck find the wrong exhausted;
Release {
StoreFile file ("Release.keystore")
Storepassword ' 111111 '
Keyalias ' Alias_name '
Keypassword ' 111111 '
}
Debug {
StoreFile file ("Release.keystore")
Storepassword ' 111111 '
Keyalias ' Alias_name '
Keypassword ' 111111 '
}
(Transferred from: HTTP://WWW.JIANSHU.COM/P/32A99C273BE1)
React native environment Creation (NODEJS Environment) development of Android environment