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

Jim G.
  • 15,141
  • 22
  • 103
  • 166
David Read
  • 635
  • 2
  • 9
  • 13
  • Hrm, I've done this but now I'm getting an "Incompatible Update" error instead. o_0 – Artem Russakovskii Jun 03 '11 at 23:32
  • 1
    While accepted answer is probably correct for your case, it is not the only one. Check what Melloware said, that was what solved my problem. Really SDK 1.7 doesn't work! Use old one, unless somebody somewhere fixes this problem. – zmilojko Dec 18 '11 at 16:51

8 Answers8

53

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.

Mark B
  • 183,023
  • 24
  • 297
  • 295
  • 1
    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. – jqpubliq Mar 25 '10 at 22:09
  • For me, it was clearing the app data (from settings) that solved the problem. – James Moore Sep 06 '11 at 01:36
  • Where is app data (from settings)? On the phone? On the computer? – theJerm Oct 21 '12 at 02:31
  • @mbaird Where on the phone is it - in a specific folder somewhere? I'm somewhat new to Android. – theJerm Oct 21 '12 at 20:18
  • @theJerm A quick Google search for "android clearing app data" turns up all the information you will ever need to know on the subject. – Mark B Oct 21 '12 at 22:23
  • @mbaird Thank you for the response - wasn't finding what I needed on Google, but I will keep looking. – theJerm Oct 22 '12 at 20:16
  • How does the phone realize that the other instance is an instance of the same app? – Omnifarious Feb 15 '13 at 22:32
  • 1
    See my answer for a common problem when developing on a tablet. http://stackoverflow.com/a/19746947/1172494 – boltup_im_coding Dec 09 '13 at 22:30
23

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.

Melloware
  • 10,435
  • 2
  • 32
  • 62
  • 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... – Santa Jan 26 '12 at 22:52
  • I've added a new answer for signing APKs with JDK7 – Xavi Ivars Aug 17 '12 at 09:34
  • 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. – Hardik Trivedi Aug 29 '12 at 05:57
  • On Unix you will need to change your JAVA_HOME environment variable or force it at the command line to point to Java6. – Melloware Dec 11 '12 at 00:56
  • 1
    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. – Erhannis Sep 10 '13 at 21:27
  • 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. – Devrim Aug 11 '14 at 08:39
16

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.

boltup_im_coding
  • 6,345
  • 6
  • 40
  • 52
  • 2
    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! – Andrea Jan 27 '14 at 20:03
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

Xavi Ivars
  • 634
  • 8
  • 22
  • 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. – Xavi Ivars Oct 24 '12 at 13:50
  • 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 Sep 07 '13 at 01:56
  • @theJerm have a look at this: http://forums.xamarin.com/discussion/28178/package-file-was-not-signed-correctly. It is the right solution, but you have to use it a little different with MonoDroid (i'm a Xamarin-Developer too) – Ursin Brunner Feb 09 '15 at 15:17
4

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
sakis kaliakoudas
  • 2,039
  • 4
  • 31
  • 51
1

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.

jqpubliq
  • 11,874
  • 2
  • 34
  • 26
  • 3
    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. – Mark B Mar 25 '10 at 21:50
  • 1
    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. – Melloware Nov 01 '11 at 11:22
1

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

Adinia
  • 3,722
  • 5
  • 40
  • 58
0

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 :)

Vaishak Suresh
  • 5,735
  • 10
  • 41
  • 66