English 中文(简体)
Published Android apk gives error "Package file was not signed correctly"
原标题:

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

最佳回答

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.

问题回答

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.

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.

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

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

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.

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

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





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签