dhatim / fastexcel

Generate and read big Excel files quickly
Other
669 stars 121 forks source link

java.lang.NoClassDefFoundError: Failed resolution of: [Ljava/nio/file/LinkOption #223

Open fcat97 opened 1 year ago

fcat97 commented 1 year ago

I'm getting

FATAL EXCEPTION: DefaultDispatcher-worker-2
Process: media.uqab.cartera, PID: 13697
java.lang.NoClassDefFoundError: Failed resolution of: [Ljava/nio/file/LinkOption;
at org.apache.commons.compress.utils.IOUtils.<clinit>(IOUtils.java:47)
at org.apache.commons.compress.utils.IOUtils.toByteArray(IOUtils.java:254)
at org.dhatim.fastexcel.reader.OPCPackage.open(OPCPackage.java:149)
at org.dhatim.fastexcel.reader.ReadableWorkbook.<init>(ReadableWorkbook.java:56)
at org.dhatim.fastexcel.reader.ReadableWorkbook.<init>(ReadableWorkbook.java:48)
at media.uqab.libCartera.data.source.LocalDatabase.readFromSdCard(LocalDatabase.kt:586)
at media.uqab.libCartera.data.repository.WalletRepositoryImpl.readFromSdCard(WalletRepositoryImpl.kt:99)
at media.uqab.libCartera.domain.useCase.ReadFromSdCard.invoke(ReadFromSdCard.kt:12)
at media.uqab.libCartera.presentation.viewmodel.SettingsViewModel$readFromSdCard$1.invokeSuspend(SettingsViewModel.kt:135)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@897c64d, Dispatchers.IO]
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.nio.file.LinkOption" on path: DexPathList[[zip file "/data/app/media.uqab.cartera-1/base.apk"],nativeLibraryDirectories=[/data/app/media.uqab.cartera-1/lib/x86, /data/app/media.uqab.cartera-1/base.apk!/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 17 more

I was trying to restore a backup that I made with org.dhatim:fastexcel:0.12.13. But got the above exception while trying to restore it with org.dhatim:fastexcel-reader:0.12.13.

The problem is only with devices (emulator) running API version 25. It perfectly restored on both virtual emulator with API 33 & actual device running API 31. May be java/nio/file/LinkOption not present in lower API.