I signed my APK in Android Studio 2.3 (build->generate signed APK). When I'm trying to upload it to Google Play store it is showing the error that I've uploaded unsigned APK. Could anyone answer why it is happening and how to solve it?
8 Answers
Android 7.0 introduces APK Signature Scheme v2, a new app-signing scheme that offers faster app install times and more protection against unauthorized alterations to APK files.
While generating signed apk there are two checkbox .
- V1 (Jar Signature)
- V2 (Full apk Signature)
There are three choices available to us:
select V1 (For older version of signing) - apk gets uploaded successfully
select V2 (For newer version of signing) - Please note that selecting this alone will not work.
select V1 and V2 (For older and newer version) - apk gets uploaded successfully
Why selecting V2 alone does not work ?
Because APK Signature Scheme v2 was introduced in Android 7.0 (Nougat). To make a APK installable on Android 6.0 (Marshmallow) and older devices, the APK should be signed using JAR signing before being signed with the v2 scheme.
For more information jump here
This is because you are using only v2 signature while taking release build.
So what is v1 and v2 mentioned?
v1 is the default signing mechanism and v2 is the newest mechanism added, which verifies much faster. This means v2-signed APKs install/update a bit faster on Android Nougat (Android 7.0, API Level 24) and newer.
So what should you do?
If you want to sign app without any changes
Check v1 (jar Signature only) which is the default.
If you want the newest signature and support for 7.x versions
Check v2 (Full Apk Signature) Which also reduces app size.
If you want app to be smaller, able to install faster and compatible with all Android versions.
Check both v1 and v2.
PS: Only applicable for signing apps with Studio, other than using pipes to build.
For more refereces Link
How To sign APK using V2
https://developer.android.com/studio/command-line/apksigner.html
Step 1) Android Studio, select View > Tool Windows > Terminal
gradlew assembleRelease
2) Align the unsigned APK using zipalign:
zipalign -v -p 4 my-app-unsigned.apk my-app-unsigned-aligned.apk
3) Sign your APK with your private key using apksigner:
apksigner sign --ks my-release-key.jks my-app-unsigned-aligned.apk --out my-app-release.apk
Note: To use the apksigner tool, you must have revision 24.0.3 or higher of the Android SDK Build Tools installed. You can update this package using the SDK Manager.
4) Verify that your APK is signed:
apksigner verify my-app-release.apk
Note: step 2 to 4 Perform in Command Prompt G:\AndroidStudio\Sdk\build-tools\25.0.0\