Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Error - App has same packaged different signature

I am getting an issue where android studio is saying

 Installation failed since the device has an application with the same package but a different signature. . . .. 

This is correct, as I recently signed an APK and uploaded to the beta area of my play developer console.

And now I am trying to debug it locally and by default I believe that all Android projects are signed by the debug keystore hence the signatures would be different.

What is the best way to deal with this? Would it be possible to sign my debug version with my release key, and is there a potential danger here?

How would I force the signing of my debug version with my release keystore without losing the ability to debug, etc.?

Or should I just keep uninstalling and reinstalling the different versions - that seems the worst possible workaround. :-)

like image 499
Martin Avatar asked Jan 10 '15 04:01

Martin


People also ask

How do I find my app signature on Android?

Android Security Verifying App Signature - Tamper Detection We can break this technique into 3 simple steps: Find your developer certificate signature. Embed your signature in a String constant in your app. Check that the signature at runtime matches our embedded developer signature.

What is Android app signature?

On Android, application signing is the first step to placing an application in its Application Sandbox. The signed application certificate defines which user ID is associated with which application; different applications run under different user IDs.

What is APK signature scheme?

APK Signature Scheme v2 is a whole-file signature scheme that increases verification speed and strengthens integrity guarantees by detecting any changes to the protected parts of the APK.

What does it mean when an app has a different signature?

This thing comes when the target device contains apk/dex (odex) file with a different signature, which is normaly due to the fact that the app is build by some others, or some other adk. Or any other adk other than yours ( i mean the one u used to create ur modified apk).

Why am I getting an error when generating signed APK?

This error usually occur when you use a different key while Generate Signed APK, Note: In order to Update your App you need to use the same Key password and key alias of your previous version then Generate the Updated Signed APK. Thanks for contributing an answer to Android Enthusiasts Stack Exchange! Please be sure to answer the question.

How do I share an app signing key between debug and release?

Then under 'Build Types', make sure that the debug target and the release target share the same signing config, and that the debug target has debuggable set to true. They should now share the same key. More information on app signing can be found in the Developer docs here.

How do I Sign my Android app with a release key?

You can sign your apps with your release key while keeping the debugging option - you just have to add your release key into Android Studio (or specify it on the command line if you are signing your apps there). In Android Studio, right click on your app in the project browser and open module settings.


2 Answers

You can sign your apps with your release key while keeping the debugging option - you just have to add your release key into Android Studio (or specify it on the command line if you are signing your apps there).

In Android Studio, right click on your app in the project browser and open module settings. Select your app's module and click on 'Signing' to make sure your release keystore is listed. Then under 'Build Types', make sure that the debug target and the release target share the same signing config, and that the debug target has debuggable set to true. They should now share the same key.

More information on app signing can be found in the Developer docs here.

I haven't heard of a downside to using the same key for debugging and for release, provided the private key is kept secure (read: not under version control).

like image 92
Aaron D Avatar answered Oct 19 '22 17:10

Aaron D


In my case after upgrading Android Studio, I had removed the $HOME/.android folder which made Android Studio create a new $HOME/.android/debug.keystore. After copying the old debug.keystore it worked again.

like image 43
Anthony Avatar answered Oct 19 '22 15:10

Anthony