问题
I have an Android project that branched into three different applications, app-1
, app-2
and app-3
, that apply some customizations. Currently there is a lot of code duplication, making maintenance a nightmare: do the changes in one of the branches, and then merge the other two.
So we create a library project, named app-core
, that factors out most of the duplicated code. So far so good.
When I launch this into an emulator where the application was already loaded (before the refactoring), I get this exception:
Re-installation failed due to different application signatures
A different signature? But I just added a line in the .classpath
to link to the app-core
Java project!
The main question is: are the existing users going to be bothered by this too?
And the side question: Why is it a different signature?
回答1:
The digital signature is driven by a signing key that exists on the machine that signs the app. If Developer A compiles an app using the standard debug key and installs it in an emulator, then tries installing some other variation of the app -- one signed with a production key, one signed with Developer B's debug key, etc. -- in the same emulator, you will get that error.
The main question is: are the existing users going to be bothered by this too?
Do you have the production signing key that you used for the version of the app your existing users are using? If yes, then there should be no problem. If no, you're screwed.
回答2:
Uninstall the application on the device, then run code again, it will work. It happens for me and I tried same thing, now it is working correctly.
回答3:
For this problem u need to check that the correct key is used under (Window->Preferences->Android->build). This u can check from the android.mk file of the app. And on placing the correct key path , CLEAN and BUILD the project to avoid this error .
回答4:
I have had the similar kind of issue. If you are installing it on your device then you need to uninstall the app on your device prior to install it from eclipse. It will definitely solve your problem.
Cheers
来源:https://stackoverflow.com/questions/2458931/why-does-the-app-signature-change-in-android-after-a-classpath-change