Jarsigner: Unable to Sign Jar: Java.Util.Zip.Zipexception: Invalid Entry Compressed Size (Expected 463 But Got 465 Bytes)

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

You are trying to sign an already signed .apk.
You need to export an unsigned .apk file and then sign it with jarsigner.

Android Signing application on Windows

You don't need to do it with commands. In Eclipse, right click on your project->Android Tools->Export Signed Application Package.

Follow the wizard and you will have an signed apk without pain.

Edit:

After a quick search about the new error, this thread seems to contain possible fix for you. At instance, please try to clean your project and build it again. If it does not fix your problem, also try the fix mentioned in the link.

Export unsigned apk from a Gradle Project in Android Studio

Use

Build > Make Project

to build an apk file from Android Studio.

You can get your unsigned apk under the below path

$YOUR_PROJECT/$YOUR_MODULE/build/apk

unsigned apk files will have "unsigned" text in their names.

[ UPDATE ] :

In Recent release of Android Studio you will not get apk file on sysncing or Make Project. There are two other methods in order to get the apk file

  1. Run the app
  2. Execute assemble Task from Gradle panel present in right hand side of Studio window or from embedded terminal window on bottom(in project Root)

gradlew assembleDebug(or whatever build varient you want a build for)

and the update new apk path will be

$YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk

This has been done by Android Tools team to improve the Android Studio performance.



Related Topics



Leave a reply



Submit