skydoves / landscapist

🌻 A pluggable, highly optimized Jetpack Compose and Kotlin Multiplatform image loading library that fetches and displays network images with Glide, Coil, and Fresco.
https://skydoves.github.io/landscapist/
Apache License 2.0
2.17k stars 114 forks source link

Failed resolution of: Lio/ktor/client/plugins/HttpTimeout #580

Closed ArleyPereira closed 1 month ago

ArleyPereira commented 1 month ago

Please complete the following information:

Describe the Bug:

kotlin = "2.0.20" ktorClientCore = "2.3.12" ksp = "2.0.20-1.0.24" koin = "4.0.0" landscapist-coil = "2.4.0"

Repository: https://github.com/ArleyPereira/FakeStoreApp/tree/problem-landscapist-coil-3

I am getting error while implementing landscapist-coil3 in my multiplatform project.

What I did:

1 - Implemented landscapist-coil3 2 - Got the project running

Process: br.com.hellodev.fakestoreapp, PID: 6666 java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/plugins/HttpTimeout; at io.ktor.client.engine.android.AndroidClientEngine.<init>(AndroidClientEngine.kt:32) at io.ktor.client.engine.android.Android.create(Android.kt:31) at io.ktor.client.HttpClientKt.HttpClient(HttpClient.kt:43) at io.ktor.client.HttpClientJvmKt.HttpClient(HttpClientJvm.kt:23) at di.NetworkModuleKt.networkModule$lambda$4$lambda$3(NetworkModule.kt:11) at di.NetworkModuleKt.$r8$lambda$CXRH0qt_TfQOCEGuLpDRJhDJyj8(Unknown Source:0) at di.NetworkModuleKt$$ExternalSyntheticLambda4.invoke(Unknown Source:4) at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:51) at org.koin.core.instance.SingleInstanceFactory.create(SingleInstanceFactory.kt:46) at org.koin.core.instance.SingleInstanceFactory.get$lambda$0(SingleInstanceFactory.kt:55) at org.koin.core.instance.SingleInstanceFactory.$r8$lambda$jURjYiIoTobJK56tn5Fhdiqjfes(Unknown Source:0) at org.koin.core.instance.SingleInstanceFactory$$ExternalSyntheticLambda0.invoke(Unknown Source:4) at org.koin.mp.KoinPlatformTools.synchronized(KoinPlatformTools.kt:36) at org.koin.core.instance.SingleInstanceFactory.get(SingleInstanceFactory.kt:53) at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:110) at org.koin.core.scope.Scope.resolveFromRegistry(Scope.kt:321) at org.koin.core.scope.Scope.resolveFromContext(Scope.kt:311) at org.koin.core.scope.Scope.stackParametersCall(Scope.kt:273) at org.koin.core.scope.Scope.resolveInstance(Scope.kt:259) at org.koin.core.scope.Scope.resolveWithOptionalLogging(Scope.kt:232) at org.koin.core.scope.Scope.get(Scope.kt:215) at di.DataModuleKt.dataModule$lambda$1$lambda$0(DataModule.kt:18) at di.DataModuleKt.$r8$lambda$oS1Vx3uXx1-Pt_-tsw-2Hq0zPtg(Unknown Source:0) at di.DataModuleKt$$ExternalSyntheticLambda0.invoke(Unknown Source:4) at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:51) at org.koin.core.instance.SingleInstanceFactory.create(SingleInstanceFactory.kt:46) at org.koin.core.instance.SingleInstanceFactory.get$lambda$0(SingleInstanceFactory.kt:55) at org.koin.core.instance.SingleInstanceFactory.$r8$lambda$jURjYiIoTobJK56tn5Fhdiqjfes(Unknown Source:0) at org.koin.core.instance.SingleInstanceFactory$$ExternalSyntheticLambda0.invoke(Unknown Source:4) at org.koin.mp.KoinPlatformTools.synchronized(KoinPlatformTools.kt:36) at org.koin.core.instance.SingleInstanceFactory.get(SingleInstanceFactory.kt:53) at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:110) at org.koin.core.scope.Scope.resolveFromRegistry(Scope.kt:321) at org.koin.core.scope.Scope.resolveFromContext(Scope.kt:311) at org.koin.core.scope.Scope.stackParametersCall(Scope.kt:273) at org.koin.core.scope.Scope.resolveInstance(Scope.kt:259) at org.koin.core.scope.Scope.resolveWithOptionalLogging(Scope.kt:232) at org.koin.core.scope.Scope.get(Scope.kt:215) at di.DomainModuleKt.domainModule$lambda$2$lambda$0(DomainModule.kt:22) at di.DomainModuleKt.$r8$lambda$0QlD1Jq7wdKvZfugwsfIhpc250k(Unknown Source:0) at di.DomainModuleKt$$ExternalSyntheticLambda0.invoke(Unknown Source:4) at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:51) at org.koin.core.instance.FactoryInstanceFactory.get(FactoryInstanceFactory.kt:38) at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:110) at org.koin.core.scope.Scope.resolveFromRegistry(Scope.kt:321) at org.koin.core.scope.Scope.resolveFromContext(Scope.kt:311) at org.koin.core.scope.Scope.stackParametersCall(Scope.kt:273) at org.koin.core.scope.Scope.resolveInstance(Scope.kt:259) at org.koin.core.scope.Scope.resolveWithOptionalLogging(Scope.kt:232) at org.koin.core.scope.Scope.get(Scope.kt:215) at di.PresentationModuleKt.presentationModule$lambda$2$lambda$0(PresentationModule.kt:26) at di.PresentationModuleKt.$r8$lambda$nVm7WBsrz4HXfnwLJoc2BUonK6Q(Unknown Source:0) (Ask Gemini) at di.PresentationModuleKt$$ExternalSyntheticLambda0.invoke(Unknown Source:4) at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:51) at org.koin.core.instance.SingleInstanceFactory.create(SingleInstanceFactory.kt:46) at org.koin.core.instance.SingleInstanceFactory.get$lambda$0(SingleInstanceFactory.kt:55) at org.koin.core.instance.SingleInstanceFactory.$r8$lambda$jURjYiIoTobJK56tn5Fhdiqjfes(Unknown Source:0) at org.koin.core.instance.SingleInstanceFactory$$ExternalSyntheticLambda0.invoke(Unknown Source:4) at org.koin.mp.KoinPlatformTools.synchronized(KoinPlatformTools.kt:36) at org.koin.core.instance.SingleInstanceFactory.get(SingleInstanceFactory.kt:53) at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:110) at org.koin.core.scope.Scope.resolveFromRegistry(Scope.kt:321) at org.koin.core.scope.Scope.resolveFromContext(Scope.kt:311) at org.koin.core.scope.Scope.stackParametersCall(Scope.kt:281) at org.koin.core.scope.Scope.resolveInstance(Scope.kt:259) at org.koin.core.scope.Scope.resolveWithOptionalLogging(Scope.kt:232) at org.koin.core.scope.Scope.get(Scope.kt:215) at org.koin.viewmodel.factory.KoinViewModelFactory.create(KoinViewModelFactory.kt:39) at androidx.lifecycle.viewmodel.ViewModelProviderImpl_androidKt.createViewModel(ViewModelProviderImpl.android.kt:34) at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release(ViewModelProviderImpl.kt:65) at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release$default(ViewModelProviderImpl.kt:47) at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.android.kt:91) at org.koin.viewmodel.GetViewModelKt.resolveViewModel(GetViewModel.kt:60) at presenter.features.products.screen.ProductsScreenKt.ProductsScreen(ProductsScreen.kt:180) at core.navigation.hosts.AppNavHostKt$AppNavHost$1$1$1.invoke(AppNavHost.kt:21) at core.navigation.hosts.AppNavHostKt$AppNavHost$1$1$1.invoke(AppNavHost.kt:20) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:139) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.navigation.compose.NavHostKt$NavHost$32$1.invoke(NavHost.kt:694) at androidx.navigation.compose.NavHostKt$NavHost$32$1.invoke(NavHost.kt:693) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:401) at androidx.compose.runtime.saveable.SaveableStateHolderImpl.SaveableStateProvider(SaveableStateHolder.kt:85) at androidx.navigation.compose.NavBackStackEntryProviderKt.SaveableStateProvider(NavBackStackEntryProvider.kt:65) at androidx.navigation.compose.NavBackStackEntryProviderKt.access$SaveableStateProvider(NavBackStackEntryProvider.kt:1) at androidx.navigation.compose.NavBackStackEntryProviderKt$LocalOwnersProvider$1.invoke(NavBackStackEntryProvider.kt:52) at androidx.navigation.compose.NavBackStackEntryProviderKt$LocalOwnersProvider$1.invoke(NavBackStackEntryProvider.kt:51) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380) at androidx.navigation.compose.NavBackStackEntryProviderKt.LocalOwnersProvider(NavBackStackEntryProvider.kt:47) at androidx.navigation.compose.NavHostKt$NavHost$32.invoke(NavHost.kt:693) at androidx.navigation.compose.NavHostKt$NavHost$32.invoke(NavHost.kt:674) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:139) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) (Ask Gemini) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1$5.invoke(AnimatedContent.kt:803) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1$5.invoke(AnimatedContent.kt:792) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:118) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.animation.AnimatedVisibilityKt.AnimatedEnterExitImpl(AnimatedVisibility.kt:771) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1.invoke(AnimatedContent.kt:774) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1.invoke(AnimatedContent.kt:757) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.animation.AnimatedContentKt.AnimatedContent(AnimatedContent.kt:816) at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:646) at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:356) at core.navigation.hosts.AppNavHostKt.AppNavHost(AppNavHost.kt:15) at core.app.ComposableSingletons$AppKt$lambda-1$1.invoke(App.kt:12) at core.app.ComposableSingletons$AppKt$lambda-1$1.invoke(App.kt:11) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:401) at androidx.compose.material3.TextKt.ProvideTextStyle(Text.kt:352) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:72) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:71) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380) at androidx.compose.material3.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:64) at core.app.AppKt.App(App.kt:11) at br.com.hellodev.fakestoreapp.ComposableSingletons$MainActivityKt$lambda-1$1.invoke(MainActivity.kt:15) at br.com.hellodev.fakestoreapp.ComposableSingletons$MainActivityKt$lambda-1$1.invoke(MainActivity.kt:14) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:441) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:259) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:258) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380) at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:216) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:132) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:131) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:380) (Ask Gemini) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:121) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:155) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:154) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:401) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:154) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:133) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:97) at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3593) at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3520) at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:743) at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:1122) at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:649) at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:635) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:133) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:124) at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:1625) at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:124) at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:180) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.jvm.kt:320) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.jvm.kt:198) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:124) at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:1706) at android.view.View.dispatchAttachedToWindow(View.java:23227) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3698) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3705) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3705) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3705) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3705) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3901) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3288) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:11344) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1689) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1698) at android.view.Choreographer.doCallbacks(Choreographer.java:1153) at android.view.Choreographer.doFrame(Choreographer.java:1079) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1646) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8919) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) (Ask Gemini) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) Caused by: java.lang.ClassNotFoundException: Didn't find class "io.ktor.client.plugins.HttpTimeout" on path: DexPathList[[zip file "/data/app/~~AH4ccSB-eAasDs2QqME8Rw==/br.com.hellodev.fakestoreapp-_ZTbtvbC1FP3teKZo965PA==/base.apk"],nativeLibraryDirectories=[/data/app/~~AH4ccSB-eAasDs2QqME8Rw==/br.com.hellodev.fakestoreapp-_ZTbtvbC1FP3teKZo965PA==/lib/arm64, /data/app/~~AH4ccSB-eAasDs2QqME8Rw==/br.com.hellodev.fakestoreapp-_ZTbtvbC1FP3teKZo965PA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259) at java.lang.ClassLoader.loadClass(ClassLoader.java:637) at java.lang.ClassLoader.loadClass(ClassLoader.java:573)

Expected Behavior:

A clear description of what you expected to happen.

skydoves commented 1 month ago

I recommend you to build again with the Ktor version 3.0.0

ArleyPereira commented 1 month ago

@skydoves It worked. Thanks!