srikanth-lingala / zip4j

A Java library for zip files and streams
Apache License 2.0
2.01k stars 307 forks source link

NoSuchMethodError on 2.11.2 #478

Closed DamonChen117 closed 1 year ago

DamonChen117 commented 1 year ago

Crashed on 2.11.2, then I switched back to 2.11.1, everything works fine. Android: 6.0.1

java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of 'java.io.File' appears in /system/framework/core-libart.jar) at net.lingala.zip4j.util.FileUtils.getRelativeFileName(FileUtils.java:225) at net.lingala.zip4j.tasks.AbstractAddFileToZipTask.cloneAndAdjustZipParameters(AbstractAddFileToZipTask.java:218) at net.lingala.zip4j.tasks.AbstractAddFileToZipTask.addFilesToZip(AbstractAddFileToZipTask.java:71) at net.lingala.zip4j.tasks.AddFolderToZipTask.executeTask(AddFolderToZipTask.java:28) at net.lingala.zip4j.tasks.AddFolderToZipTask.executeTask(AddFolderToZipTask.java:17) at net.lingala.zip4j.tasks.AsyncZipTask.performTaskWithErrorHandling(AsyncZipTask.java:51) at net.lingala.zip4j.tasks.AsyncZipTask.execute(AsyncZipTask.java:45) at net.lingala.zip4j.ZipFile.addFolder(ZipFile.java:391) at net.lingala.zip4j.ZipFile.addFolder(ZipFile.java:366) at net.lingala.zip4j.ZipFile.addFolder(ZipFile.java:332)

erictamhk commented 1 year ago

I got the same issues too Android: 7.0

Kntntn commented 1 year ago

Same for me, it occurs on API 25 and below. Seems to be related to the addFolder method, the addFile works fine.

erictamhk commented 1 year ago

after update to 2.11.3, the issues were gone.

srikanth-lingala commented 1 year ago

I pushed a fix as part of #484 which should fix this issue. I will include this in the next release

srikanth-lingala commented 1 year ago

Fixed in v2.11.4 released today