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.