You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing a NoClassDefFoundError related to androidx.compose.runtime.PrimitiveSnapshotStateKt while implementing Coil's multiplatform library in my project. This error arises during runtime and results in the application crashing. The problem appears to be associated with the integration of Coil in a Jetpack Compose multiplatform environment. Previously, I managed image loading using a custom setup with Compose Coil for Android and Java libraries for desktop.
Implementation Details
The following Coil dependencies are included in the project:
and on androidMain implementation("io.ktor:ktor-client-okhttp:2.3.7")
Sample fucntion (on commonMain)
@Composable
fun myImageDownloader (url: String){
AsyncImage(
model = ImageRequest.Builder(LocalPlatformContext.current)
.data(url)
.build(),
contentDescription = null,
modifier = Modifier.fillMaxSize(),
)
}
I've not set R8 or proguard but i added rules like in documentation in case ... I also invalided cache, files etc ..
Process: com.myapplication.MyApplication, PID: 24685
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/runtime/PrimitiveSnapshotStateKt;
at coil3.compose.AsyncImagePainter.<init>(AsyncImagePainter.common.kt:184)
at coil3.compose.AsyncImagePainter_commonKt.rememberAsyncImagePainter-GSdzBsE(AsyncImagePainter.common.kt:159)
at coil3.compose.AsyncImagePainter_commonKt.rememberAsyncImagePainter-0YpotYA(AsyncImagePainter.common.kt:140)
at coil3.compose.AsyncImageKt.AsyncImage-YIYSHzI(AsyncImage.kt:151)
at coil3.compose.AsyncImageKt.AsyncImage-sKDTAoQ(AsyncImage.kt:120)
at coil3.compose.SingletonAsyncImageKt.AsyncImage-10Xjiaw(SingletonAsyncImage.kt:120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.compose.runtime.PrimitiveSnapshotStateKt" on path: DexPathList[[zip file "/data/app/.../base.apk"],nativeLibraryDirectories=[/data/app/.../lib/arm64, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
I have spent several hours trying to diagnose and resolve this issue without success. Any guidance or suggestions from the community would be greatly appreciated. Thank You
The text was updated successfully, but these errors were encountered:
@colinrtwhite Ok thank you anyway. Could have been this but i disable all accompanist/systemuicontroller on my code and unfortunately the problem persist. Previously I had no problem wioth coil2 with actual expect mechanism and the crash error seems indicate the problem is related to coil3
edit: solved by updating androidx.tv:tv package to last version
I'm experiencing a NoClassDefFoundError related to androidx.compose.runtime.PrimitiveSnapshotStateKt while implementing Coil's multiplatform library in my project. This error arises during runtime and results in the application crashing. The problem appears to be associated with the integration of Coil in a Jetpack Compose multiplatform environment. Previously, I managed image loading using a custom setup with Compose Coil for Android and Java libraries for desktop.
Implementation Details
The following Coil dependencies are included in the project:
on commonMain:
and on androidMain
implementation("io.ktor:ktor-client-okhttp:2.3.7")
Sample fucntion (on commonMain)
I've not set R8 or proguard but i added rules like in documentation in case ... I also invalided cache, files etc ..
I have spent several hours trying to diagnose and resolve this issue without success. Any guidance or suggestions from the community would be greatly appreciated. Thank You
The text was updated successfully, but these errors were encountered: