1, generate a signature key method 1:[java] View plain copy
- Keytool-genkey-v-keystore my-release-key.keystore-alias my-key-alias-keyalg rsa-keysize 2048-validity 10000
Method 2: First Open the Androidstudio menu select Build->generate signed APK in the Open interface click Next, will pop up the following interface then click Create New in the pop-up interface, select the location, name, password to fill in the secret key. Also write the name of the alias, the owner of the certificate, the country, the organization, and the information about the city. Click OK, will default fill in the creation of the signature information, last click Finish will generate a signature key, but please note that the key generated here and the first command line method of the key suffix is not the same, this side is to JKs end, but no problem oh ~ The same can be signed. Copy the resulting file to the directory: AA.JKS2, add gradle.properties file in C:\Users search .gradle, into file, new gradle.properties, add Myapp_release_ Store_file=aa.jks (key file) myapp_release_key_alias=test (first name) myapp_release_store_password=123456 (password) MYAPP_RELEASE_ key_password=123456 (password) 3, modify the F:\react Native\kang2\kang2\android\app folder: signingconfigs {release {StoreFile File (myapp_release_store_file) Storepassword Myapp_release_store_passwordkeyalias Myapp_release_key_ Aliaskeypassword Myapp_release_key_password}}buildtypes {RELEASE {minifyenabled Enableproguardinreleasebuildsproguardfiles getdefaultproguardfile ("Proguard-android.txt"), "Proguard-rules.pro" Signingconfig signingconfigs.release}} 4, go to the root directory: Run CD Android in run Gradlew assemblerelease success: app-ralease.apk error: ' Gradlew ' is not an internal or external command, nor is it a running program solution: Go to Android directory in CD Android
React native Android app package