Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Re-installation failed due to different application signatures" - possible to override?

I am developing my app on two PCs so obviously I get the error in Eclipse "Re-installation failed due to different application signatures" when trying to deploy on the physical device which has a copy of the app from the other machine.

My question is: is it possible to override this, meaning to deploy the app DESPITE different signatures?

The reason is that my app has a database which I don't want to wipe, because I am fixing a bug relating to it. Is there a quick fix that doesn't require uninstalling the app/copying the keyrstore file between the PCs ? Bet there isn't, but just asking. Thanks!

like image 553
TomaszRykala Avatar asked Apr 30 '11 13:04

TomaszRykala


1 Answers

NO, there is no way to override it. From the documentation:

When the system is installing an update to an application, it compares the certificate(s) in the new version with those in the existing version. If the certificates match exactly, including both the certificate data and order, then the system allows the update.

One way to work around this will be to try to sign the apps on both machines with the same keystore. If you are using Eclipse,

  1. Go to Preferences -> Android -> Build There you should find the path to the 'Default debug keystore'. (usually something like /Users/username/.android/debug.keystore.
  2. Copy this file to the new machine.
  3. Inside Eclipse on the new machine, open Preferences -> Android -> Build
  4. Enter the path to the file in the field 'Custom debug keystore'
  5. Save and then you can run your app and have it signed with the same key.

Good luck

UPDATE:

It is now possible to configure your signing key in Gradle (which will be used by Android Studio) and include your debug key in source control. Just add the key to your project folder and then add the following to your build.gradle file:

signingConfigs {
        debug {
            storeFile file("../debug.keystore")
        }
    }

And also add this under build types:

buildTypes {        
    debug {
        debuggable true
        signingConfig signingConfigs.debug
    }
}

See the documentation for more details

like image 134
codinguser Avatar answered Nov 17 '22 14:11

codinguser