Android + Zip4j-1.3.1 jar throws VerifyError

Go To StackoverFlow.com

1

I am trying to use the zip4j jar file in my android project to password protect the zip file in the application. Copied the jar in lib folder & added it to build path. The code compiles fine. But when I run the project it gives VerifyError.

NOTE: It works fine if I added the source code to the project instead of the jar.

E/dalvikvm(1502): Could not find class 'net.lingala.zip4j.core.ZipFile', referenced from method a.test.zip.ZipHelper.zipFilesWithStandardZipEncryption
W/dalvikvm(1502): VFY: unable to resolve new-instance 45 (Lnet/lingala/zip4j/core/ZipFile;) in La/test/zip/ZipHelper;
D/dalvikvm(1502): VFY: replacing opcode 0x22 at 0x002a
W/dalvikvm(1502): VFY: unable to resolve exception class 46 (Lnet/lingala/zip4j/exception/ZipException;)
W/dalvikvm(1502): VFY: unable to find exception handler at addr 0x78
W/dalvikvm(1502): VFY:  rejected La/test/zip/ZipHelper;.zipFilesWithStandardZipEncryption (Landroid/content/Context;)V
W/dalvikvm(1502): VFY:  rejecting opcode 0x0d at 0x0078
W/dalvikvm(1502): VFY:  rejected La/test/zip/ZipHelper;.zipFilesWithStandardZipEncryption (Landroid/content/Context;)V
W/dalvikvm(1502): Verifier rejected class La/test/zip/ZipHelper;
D/AndroidRuntime(1502): Shutting down VM
W/dalvikvm(1502): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
2012-04-05 15:36
by Shabbir


2

where did you put your jar file? not necessary, but in some cases it works as follows: you need to put your jar in assets folder. then you configure your Java builtpath. add the jar from assets folder, then (in eclipse, get to order and export tab and check the jar file) export the jar. it automatically adds it into your applications lib folder. i don't know why but it didn't work the other way around (coppying the jar in lib and adding it to builtpath) in one of my applications. you can also change your java compiler.

2012-04-11 13:18
by cagla
ok. it may not always put a copy in lib folder. :) so simply copy and past - cagla 2012-04-12 06:46
Thanks, adding the file to assets folder worked. But usually I have been adding jar files to lib & they worked - Shabbir 2012-04-16 04:38
Ads