21

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!

James Miller
  • 213
  • 1
  • 2
  • 6
  • you got a signed apk and you tried to install it in your device (mentioned Q), right? tell me, did you uninstall previous apk from your device (the one you used while testing on normal basis)? – aB9 Sep 25 '15 at 05:57

4 Answers4

36

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.

Bidhan
  • 10,607
  • 3
  • 39
  • 50
28

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.

edestrero
  • 516
  • 6
  • 5
9

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

Saik Caskey
  • 500
  • 4
  • 18
  • 1
    This worked for me. I was trying to install a signed release APK on a Genymotion emulator using drag-and-drop of the APK file. The Debug version of the app was already installed on the emulator. It was failing with a generic/uninformative message. After I uninstalled the Debug version as described above, I was able to install the signed release APK using drag-and-drop. – dazed May 14 '18 at 13:51
7

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. See: https://developer.android.com/about/versions/nougat/android-7.0.html#apk_signature_v2

Danylo
  • 5,152
  • 2
  • 17
  • 13