Published Android apk gives error “Package file was not signed correctly”

老子叫甜甜 提交于 2019-11-26 13:48:41

问题


I recently uploaded my application to the android market however it's refusing to run when downloaded due to the error

Package file was not signed correctly

I first published the packet using eclipse, right click export, creating a keystore then publishing, however it refuses to work.

I then downloaded the keytool and jarsigner and used them to sign an upgrade which I posted instead. However this gives the same error.

I have no idea what I've done wrong, and since I cannot delete the application I cannot try and start again can anyone help me?

Thanks


回答1:


You have your debug copy still installed on your device most likely. Now you have downloaded a different copy of the same app and it's causing this error.

Uninstall the app completely from your device. Then download it from the market again and it should work.




回答2:


OK I had this same issue and none of the suggested resolutions worked for me. I was signing my app the same way I have been for 2 years and the Android Market was accepting it fine, just users could not download it from the Market with the "Package Not Signed" error.

What it turned out to be was for another project I am working on I had JDK7 installed. It became the default JDK and for some reason the keytool for JDK7 is signing the package in a way that Android must not like. So I reverted to JDK 1.6.0_23 and re-ran my build and put it on the Market and everything went back to normal.

I hope this helps someone else.




回答3:


On a tablet, note that if you install a debug version of the app and then uninstall it as normal (dragging to trash until it says "uninstall") that is not enough. Because tablets have the potential for multiple users, you HAVE to go to

 Settings > Apps > All

and then scroll all the way to the very bottom. There, you will see your app. Tap it, and then hit Menu in the action bar (the three dots), and then uninstall for all users. Then you'll be good to go.




回答4:


There's a problem when signing APKs with JDK7. You can solve it adding this to build.xml

<presetdef name="signjar">
    <signjar sigalg="MD5withRSA" digestalg="SHA1" />
</presetdef>

Source: KIYUT Developer Blog




回答5:


Recently, I signed my apks from the command line and got this error. I solved this error through the instructions in this link:

http://developer.android.com/tools/publishing/app-signing.html

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name



回答6:


This error usually occurs because you are trying to push an update which was signed with a different key than you used in the initial submission. You need to find the key you used the first time you published the application and use this to sign the update.




回答7:


I had the same problem with my developed app.

Go to the App Manager, clear the data for the app, then force stop if it's running and uninstall it. Then try again to install from market. This worked for me.

https://market.android.com/details?id=net.trackmelite.GoogleMaps&feature=search_result




回答8:


I am new to Android but I was able to resolve the issue magically :D
I used Java 1.7 with my app and used command line utilities [keytool, jarsinger and zipalign] to sign my app and got the same error.
Then I went back to Eclipse and used the Android tool "Export Signed Application Package" with the same keystore I had originally published my app with; took that APK and used the command line to zipalign it.[Had to increment the versioncode in the manifest btw]. I unpublished the old APK and published this new one. Once you do this, do not test it immediately.
Not sure how long you have to wait but mine was working 4 hours later when I checked :)



来源:https://stackoverflow.com/questions/2519374/published-android-apk-gives-error-package-file-was-not-signed-correctly

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