Published Android apk gives error "Package file was not signed correctly"

34,379

Solution 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.

Solution 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.

Solution 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.

Solution 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

Solution 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
Share:
34,379
David Read
Author by

David Read

Updated on July 09, 2022

Comments

  • David Read
    David Read almost 2 years

    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

  • Mark B
    Mark B over 14 years
    The error you are referring to is the error you get when uploading to the market. He's getting an error when he tries to run the app.
  • jqpubliq
    jqpubliq over 14 years
    You can't have two instances of an app on the same device. If he had the debug copy with the same version number he would have to uninstall it before he could even download it. Installing a higher version over a debug version might be the culprit though.
  • James Moore
    James Moore almost 13 years
    For me, it was clearing the app data (from settings) that solved the problem.
  • Melloware
    Melloware over 12 years
    In my case it was because i started accidentially signing my app with JDK7 keytool which the Market must not like. Switching back to 1.6 keytool then made this problem go away.
  • Santa
    Santa over 12 years
    Had the same problem. This was the culprit (in my case, anyway)! I wonder what changed in JDK7 not to have its keytool incompatible with JDK6 like that...
  • Xavi Ivars
    Xavi Ivars almost 12 years
    I've added a new answer for signing APKs with JDK7
  • Hardik Trivedi
    Hardik Trivedi almost 12 years
    Melloware I am also facing the same problem. And I think the solution which you gave of rebuilding app using 1.6 is totally correct. But I am using Unix. How can I specify that App should build using 1.6 version. I build app using commands executed on terminal.
  • theJerm
    theJerm over 11 years
    Where is app data (from settings)? On the phone? On the computer?
  • theJerm
    theJerm over 11 years
    @mbaird Where on the phone is it - in a specific folder somewhere? I'm somewhat new to Android.
  • Mark B
    Mark B over 11 years
    @theJerm A quick Google search for "android clearing app data" turns up all the information you will ever need to know on the subject.
  • theJerm
    theJerm over 11 years
    @mbaird Thank you for the response - wasn't finding what I needed on Google, but I will keep looking.
  • Xavi Ivars
    Xavi Ivars over 11 years
    I'm sorry, I have no idea about MonoDroid, if it uses the same files that a standard Android Project uses. If I'm not wrong, in a standard Androd project, build.xml is in the root folder of the project.
  • Melloware
    Melloware over 11 years
    On Unix you will need to change your JAVA_HOME environment variable or force it at the command line to point to Java6.
  • Omnifarious
    Omnifarious over 11 years
    How does the phone realize that the other instance is an instance of the same app?
  • Erhannis
    Erhannis almost 11 years
    Hmm, I can't find a build.xml. I'm using Eclipse; fairly standard, right? Does one of the other files correspond to it, such as project.properties, default.properties, AndroidManifest.xml, or .project?
  • Erhannis
    Erhannis almost 11 years
    Note that while a different signing algorithm may sometimes be the problem, it wasn't in my case. Both 1.7 and 1.6 signed it with dsaWithSHA1, but 1.6 worked where 1.7 didn't. Also, for some reason only Android 2.2 had a problem with the APKs signed by 1.7.
  • boltup_im_coding
    boltup_im_coding over 10 years
    See my answer for a common problem when developing on a tablet. stackoverflow.com/a/19746947/1172494
  • Andrea
    Andrea over 10 years
    I had exactly this situation - debug version on a tablet, put it into beta at the Play store, tried to download, got the error. Deinstalled via Settings but it didn't work until I followed your instructions. Thank you!
  • Devrim
    Devrim almost 10 years
    Problem occurs if apk is created with java 1.7 and device is android 2.2. @Melloware it would be better if you add this tip to your answer.
  • Ursin Brunner
    Ursin Brunner over 9 years
    @theJerm have a look at this: forums.xamarin.com/discussion/28178/…. It is the right solution, but you have to use it a little different with MonoDroid (i'm a Xamarin-Developer too)