ApkModule.loadApkFile(file) crash
Hi, when I want to load a file in API 21 (android 5) I'm getting following error but in API 34 its ok, thanks in advance to helping me.
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 com.reandroid.archive.io.ZipFileInput.getFileChannel(ZipFileInput.java:84)
at com.reandroid.archive.io.ZipFileInput.getFooter(ZipFileInput.java:69)
at com.reandroid.archive.block.EndRecord.findEndRecord(EndRecord.java:61)
at com.reandroid.archive.model.CentralFileDirectory.visit(CentralFileDirectory.java:48)
at com.reandroid.archive.Archive.
As documented here File#toPath() is introduced on API 26.
If you can, at ZipFileInput:
change fileChannel = FileChannel.open(this.file.toPath(), StandardOpenOption.READ);
to fileChannel = new FileInputStream(file).getChannel();
i added your module in my project, so I don't have access to modify your file, unless I copy all your file into my project :)
As documented here File#toPath() is introduced on API 26.
If you can, at ZipFileInput: change
fileChannel = FileChannel.open(this.file.toPath(), StandardOpenOption.READ);tofileChannel = new FileInputStream(file).getChannel();
Request the latest Releases:https://github.com/REAndroid/ARSCLib/releases
i know it, but the REAndroid should fix it, Im using the latest version
@mahdizareeii I tested it myself, getting ARSCLib to work in api 21 would require a lot of changes. For now, I'm enabling desugaring (nio version) in my project to make it work.
I'm considering making an api 21-compatible fork.
@kaanelloed i'll try it, thanks my bro