Configure the runtime signature in android studio, androidstudio

Source: Internet
Author: User

Configure the runtime signature in android studio, androidstudio

Third-party interfaces are sometimes required for projects, while basic third-party interfaces require signature first. As a result, you have to manually sign each debugging operation, which is really troublesome. Therefore, android studio provides a method for automatically signing when running. in gradle (Module: app), we didn't know how to directly use code configuration at the beginning, so we can use the visual window of android studio for editing.

1. Open Build-> Edit Build Types-> Signing,

2. Configure the signature File here, click the plus sign, enter name, Key Alias, key Password, Store File (path of the signature File), and Store Password

3. Click debug for Build Types.

4. Click release.

After the project is built, the following code is generated in the gradle file:

 

Note that signingConfigs should be placed before buildTypes, otherwise TestConfig will not be found

 

android {    signingConfigs {        Testconfig {            keyAlias 'Test'            keyPassword '1234'            storeFile file('D:/key.jks')            storePassword '1234'        }    }   .
.
.
buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.Testconfig } debug { signingConfig signingConfigs.Testconfig } }}

This is OK. The following is a set of meanings of each attribute during signing Configuration:

If an error occurs during the build process:

The password is incorrect. Check the password.

 

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.