Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Installation failed since APK was not signed

I am attempting to run my app in an emulator and have been receiving the following error:

Installation failed since the APK was either not signed, or signed incorrectly. If this is a Gradle-based project, then make sure the signing configuration is specified in the Gradle build script.

I am attempting to run the app with a debug setting so signing the app should not be necessary as it will be given a temporary signature upon building.

like image 551
ImpromptuMusic Avatar asked Mar 05 '15 18:03

ImpromptuMusic


People also ask

Can I install an unsigned APK on Android?

If you need to install such an app for your Android device, you can still do so, but you'll need to enable settings inside Android that enable you to install unsigned third-party apps. These settings are located inside the Android Settings app.

Does APK need to be signed?

All applications must be signed. The system will not install an application on an emulator or a device if it is not signed. To test and debug your application, the build tools sign your application with a special debug key that is created by the Android SDK build tools.

Can not install unsigned APK?

You cannot install an unsigned application on a phone. You can only use it to test with an emulator. If you still want to go ahead, you can try self-signing the application. Also, since you are installing the application from an SD card, I hope you have the necessary permissions set.


2 Answers

This happens often when you install the same app generated on a different computer. Even the unsigned apk has a signature, so your phone is confused why you're trying to install something with the same package name that was generated on a different computer.

Go to your settings -> apps, then find the app in the list, and clear its data and uninstall it.

Then try installing again. That'll fix it.

like image 69
Alex K Avatar answered Sep 27 '22 18:09

Alex K


This problem can be resolved by below two ways

  1. Change Built Variant to debug cnange_built_variant
  2. Define your application`s signingConfigs signingConfigs

First solution works when you built your application in debug mode. But, once you are ready to publish your application on Google Play store you need to go by second way.

Read for more -> Sign Your App

Hope this will help one and all!

like image 35
Rupesh Yadav Avatar answered Sep 27 '22 19:09

Rupesh Yadav