In fact, according to the official documentation, step by step is fine, but I didn’t read it at first. List a few points to note ⚠️ :
Build->Generate Signed Ask… ‘This step generates the signed packaged APK, because the generated APK can’t package the JS part, opening the application will directly report an error, because the JS Bundle is missing.
2 If your application references many third-party libraries, the following errors may be reported
com.android.dex.DexIndexOverflowException: Cannot merge new index 65562 into a non-jumbo instruction
Don’t be nervous at this time, this is the famous DEX 64K problem. It is said that Dalvik originally designed a single DEX to store the ID of 65536 methods at most, so if there are too many methods, this problem will occur. You can refer to this link 🔗or that link 🔗. The way I did it was in
```Java
android {
dexOptions {
jumboMode = true
}
}
Copy the code
The downside of this is that APK doesn’t work on lower versions of devices, and I have minSdkVersion 16 and can’t find that phone right now, so I’m not worried.
If you want to store your secret key and password in gradle.properties for security, don’t put quotes around these variables. In addition, the path of keystore should be in the app directory. You can write the variable name directly to the file name instead of the path.
If your application requires a third-party login such as wechat login, you may need a key hash (certificate, etc.) to generate this, run the following command directly from the terminal CD to your Keystone directory
keytool -exportcert -alias XXX -keystore XXX.keystore | openssl sha1 -binary | openssl base64
Copy the code
Ensure that the alias and keystore match properly. Otherwise, the third-party login may fail due to the certificate failure.