Open Androidstudio, and open the project where you want to build the APK file.
- Click "Builder" above the toolbar
Click "Builder" in the drop-down menu to see "Genarate singed APK", click this option!
The developer will then be asked to enter the relevant key file and password
If the developer has already had their own key file, this time will automatically query to the previous key file (if there is no automatic query to also can manually find), find and then enter the password on the halfway, if there is an error, it is possible that the key file is not configured correctly, you need to re-request a key file.
To request a new key file, click "Create New ..." In the previous image to open the dialog box for the new key file and enter the appropriate information in the dialog box.
- After the generation of a new key file will automatically return to select the Key File dialog box, at this time only need to enter the application of the password to use it, then choose to generate the APK file some information, you can choose, but generally recommended to use the default settings.
Android Studio finally signature version (signature version selection) , when the official package found that more than a signature version of the choice:
You can see the choice of the signature version, because the default tick of the V2 (full APK Signature), not much want to go all the way down,
Results on the test machine (5.0.1) has been installed failure, thinking and the choice of signature version has a relationship, then check it.
Problem Description (V1 and v2)
Android 7.0 introduced apk Signature Scheme v2,v1 is the jar Signature from the JDK
V1: It should be verified by a zip entry so that many changes can be made after the APK is signed-it is possible to move or even re-compress the file.
V2: Validates all the bytes of a compressed file, not a single ZIP entry, and therefore cannot be changed (including Zipalign) after signing. Because of this, we are now in the process of compiling, merging the compression, adjustment, and signing into one step. The benefits are obvious, more secure, and the new signature shortens the time it takes to authenticate on the device (it does not take a lengthy process to decompress and then validate), which speeds up the application installation.
Solution One
V1 and V2 signatures are used
Checking only the V1 signature does not affect anything, but it does not use a more secure authentication method on 7.0
Only check V2 Signature 7.0 The following will be installed directly after the display is not installed, more than 7.0 of the V2 method is used to verify
While checking V1 and V2, all models are fine.
Solution II
Add the following to the app's Build.gradle android tab
[Java]View PlainCopy
- Signingconfigs {
- Debug {
- V1signingenabled True
- V2signingenabled True
- }
- Release {
- V1signingenabled True
- V2signingenabled True
- }
- }
Android Studio Package Build apk