Why does the app signature change in Android after a classpath change?

对着背影说爱祢 提交于 2019-11-27 07:06:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!