Android Studio Package Build apk

Source: Internet
Author: User

  1. Open Androidstudio, and open the project where you want to build the APK file.

  2. Click "Builder" above the toolbar
  3. Click "Builder" in the drop-down menu to see "Genarate singed APK", click this option!

  4. The developer will then be asked to enter the relevant key file and password

  5. 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.

  6. 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.

  7. 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.
  8. 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
    1. Signingconfigs {
    2. Debug {
    3. V1signingenabled True
    4. V2signingenabled True
    5. }
    6. Release {
    7. V1signingenabled True
    8. V2signingenabled True
    9. }
    10. }


Android Studio Package Build apk

Related Article

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.