React native environment Creation (NODEJS Environment) development of Android environment

Source: Internet
Author: User

(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.propertiesFile, 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.gradleSignature 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.