React-native Android Pack

Source: Internet
Author: User

Steps

1. Generate key

2. Modify the android/app/build.gradle file

3. Modify android/gradle.properties

4. CD android && ./gradlew assembleRelease

Enter a directory and execute

$ keytool-genkey-v-keystore my -release-key.keystore- alias my -key- alias -keyalg rsa-keysize 2048 -validity 10000

The resulting file will be copied to the project directory/android/app under the current directory.

Configure Build.gradle

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 {
Minifyenabled Enableproguardinreleasebuilds
Proguardfiles getdefaultproguardfile ("Proguard-android.txt"), "Proguard-rules.pro"
Signingconfig Signingconfigs.release
}
}

And then modify the Android/gradle.properties

Add the following content

Myapp_release_store_file=my-release-key.keystore

Myapp_release_key_alias=my-key-alias

myapp_release_store_password=123456// The password I tested was 123456.

myapp_release_key_password=123456

Follow the official steps to perform the final step

 Cdandroid && ./gradlew assembleRelease,

If you have the NDK installed, then no surprises will successfully package successfully, see in the app/build/outputs/apk directory:

If there is no ndk, download a corresponding version.

After downloading, then add  local.properties in the directory.
Add the following content :
Configure the  sdk.dir and address 
Pay attention to the double rod
Example :
Sdk.dir=d:\\android_sdk
ndk.dir=d:\\android_sdk\\android-ndk-r12b
Finally to the last step ; Enter
Cd android
执行  gradlew assembleRelease
If there is no accident, after the successful execution will be in the app/build/outputs/apk directory to see the dear apk .

React-native Android Pack

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.