First, create a signature file in Android Studio.
1. Select the project in Android Studio and choose Build in the menu bar.
2. Click the Generate Signed APK tab.
3. Copy the generated JKS files to the project file, as in my project structure directory.
Second, in the build file to add their own signature of relevant information.
Signingconfigs { myconfig { storefile file ("**.jks ") "* *" "* * " "* *"//Replace the "* *" here with your own information } } buildtypes { release { signingconfig signingconfigs.myconfig//don't forget to include me in the release. The signature configuration information false proguardfiles Getdefaultproguardfile (' proguard-android.txt '), ' Proguard-rules.pro ' } }
In this case, we have configured, how we can complete our signature building there are two methods.
Third, the use of Gradle to complete the app signature construction.
1, using Android Studio for our built-in good gradle command. In the Android Studio development tool we found the Gradle tab:
The command to mark with a red line is the one we signed and packaged. We just double click with the mouse and the command starts to execute:
When we saw build successful, we were able to build. Next we look at our apk file generation.
The signature was successful!
2, we also have a way to knock orders. Open the Terminal tab. When we open it, we'll knock. Gradle--help command to verify that the Gradle command can be executed. If not, inside the environment variable
Configure the path of the Gradle.
Gradle Assemblerelease
Android Studio Gradle Automatic signature Build implementation