开发者

Resigning my app with the same keystore failed

开发者 https://www.devze.com 2023-03-10 02:36 出处:网络
Salam all, I\'ve created an app for android 2.2 using Eclipse and I have signed using a keystore that I have created, then I have upload it to the Market.

Salam all,

I've created an app for android 2.2 using Eclipse and I have signed using a keystore that I have created, then I have upload it to the Market.

I have done some changes on the app, I have changed the app version from 1.0 tp 1.1, then I have tried to sign the new generated .apk file but I've got the following error:

jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 525 but got 527 bytes).

This error occurs when you try to sing a signed .apk file, I have generated an unsigned .apk from Eclipse and my app signed successfuly.

Now the Mark开发者_Python百科et refuses my new signed app, I guess that the first version was signed by Eclpise and my keystore, now I cannot have a new version signed by both. is this true analysis?

What am I doing wrong?


To get an unsigned apk in Eclipse, right click on application name in the Package Explorer window and choose Android Tools, then choose "Export Unsigned Application Package...". Save the package to a new location. Once you have an unsigned apk. Run the jarsigner command you were using on the unsigned apk file.

    $ jarsigner -verbose -keystore my-release-key.keystore my_application.apk alias_name    
    $ jarsigner -verify my_signed.apk    
    $ jarsigner -verify -verbose -certs my_application.apk      

Note: If you see "CN=Android Debug", this means the .apk was signed with the debug key generated by the Android SDK. If you intend to release your application, you must sign it with your private key instead of the debug key.

    $ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk    
    $ zipalign -c -v <alignment> existing.apk     

Source: http://forum.xda-developers.com/showthread.php?t=492822 http://developer.android.com/guide/developing/tools/zipalign.html

This fixed my issue

0

精彩评论

暂无评论...
验证码 换一张
取 消