I am in Android Studio and signing an APK under Build > Generate Signed APK and using the wizard. Everything appears to sign fine and an .apk file is generated.
When I go copy this file over to my device (either Nexus 7 or Moto X) it won’t install. I get an “install failed” message.
I can’t figure out what’s going wrong at all. I have put this .apk up in the google play developer console under “alpha testing” and it was accepted fine (I’m waiting for the tester link to become active to try and download / install from there).
The instructions for the wizard here (http://developer.android.com/tools/publishing/app-signing.html#studio) show in the screenshot of the final stage a drop down called “Build Type” selected to “release”. I don’t have that in my version of Android Studio. There isn’t anything I can find in this wizard that will let me specify a “release” build.
Any help anyone can give me would be so much appreciated. Thanks!
You need to be in release mode to generate a signed APK. On the lower left corner of your Android Studio should be a tiny square icon. Click on it and a menu shall pop up. Now choose Build Variants and you’ll get a table with two columns: Module and Build Variant. There must be debug written below Build Variant. Click on it and you will get a dropdown. Now click on release and Gradle will start building the release version. Once it is completed generate the signed APK.
my 2 cents: with Android Studio 2.3 you can sign an app in two ways: v1 jar signature, v2 full apk signature.
I was using the v2 option and this caused the signed app to not install on my android device.
I then unchecked the v2 option, checked the v1 one and the apk now installs as expected.
Late to the game but here’s something stupid that worked for me:
I had to uninstall the app for all users in Settings>Apps>MyApp
If you just uninstall it sometimes just removes it from your account and not the device, so you’d have a version or certificate mismatch when you tried to install the new APK.
Hope that helps someone
Yes. If you have two options before generation signed apk (V1 and V2) you should use V1 jar signature now, because there is no backward compatibility and all android phones with version < 7 won’t accept this signature.
Backward compatibility will be added in some next N Developer Preview.