Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashing with error message in KTOR #78

Open
sabbirreyjohn opened this issue Dec 24, 2024 · 1 comment
Open

App crashing with error message in KTOR #78

sabbirreyjohn opened this issue Dec 24, 2024 · 1 comment

Comments

@sabbirreyjohn
Copy link

Hello,
I was using KTOR as networking library in one of my android(not KMP) project. After taking these two libraries my app started getting crashes :

implementation("io.github.mirzemehdi:kmpauth-google:2.3.0-beta01")
implementation("io.github.mirzemehdi:kmpauth-uihelper:2.3.0-beta01")

Here is the log:
java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/plugins/contentnegotiation/ContentNegotiation;
at xyz.androidrey.multimoduletemplate.network.http.HttpClientBuilder$build$1.invoke(HttpClientBuilder.kt:52)
at xyz.androidrey.multimoduletemplate.network.http.HttpClientBuilder$build$1.invoke(HttpClientBuilder.kt:30)
at io.ktor.client.HttpClientKt.HttpClient(HttpClient.kt:42)
at xyz.androidrey.multimoduletemplate.network.http.HttpClientBuilder.build(HttpClientBuilder.kt:30)
at live.studyquran.android.common.domain.di.CommonModule.provideHttpClient(CommonModule.kt:28)
at live.studyquran.android.common.domain.di.CommonModule_ProvideHttpClientFactory.provideHttpClient(CommonModule_ProvideHttpClientFactory.java:41)
at xyz.androidrey.multimoduletemplate.DaggerTheApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get(DaggerTheApplication_HiltComponents_SingletonC.java:679)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at xyz.androidrey.multimoduletemplate.DaggerTheApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get(DaggerTheApplication_HiltComponents_SingletonC.java:676)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at xyz.androidrey.multimoduletemplate.DaggerTheApplication_HiltComponents_SingletonC$SingletonCImpl.authRepositoryImpl(DaggerTheApplication_HiltComponents_SingletonC.java:614)
at xyz.androidrey.multimoduletemplate.DaggerTheApplication_HiltComponents_SingletonC$SingletonCImpl.-$$Nest$mauthRepositoryImpl(Unknown Source:0)
at xyz.androidrey.multimoduletemplate.DaggerTheApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get(DaggerTheApplication_HiltComponents_SingletonC.java:673)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at xyz.androidrey.multimoduletemplate.DaggerTheApplication_HiltComponents_SingletonC$ViewModelCImpl$SwitchingProvider.get(DaggerTheApplication_HiltComponents_SingletonC.java:504)
at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory$2.createViewModel(HiltViewModelFactory.java:133)
at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory$2.create(HiltViewModelFactory.java:104)
at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.create(HiltViewModelFactory.java:171)
at androidx.lifecycle.ViewModelProvider$Factory.create(ViewModelProvider.android.kt:158)
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 androidx.lifecycle.viewmodel.compose.ViewModelKt__ViewModelKt.get(ViewModel.kt:162)
at androidx.lifecycle.viewmodel.compose.ViewModelKt.get(Unknown Source:1)
at androidx.lifecycle.viewmodel.compose.ViewModelKt__ViewModel_androidKt.viewModel(ViewModel.android.kt:124)
at androidx.lifecycle.viewmodel.compose.ViewModelKt.viewModel(Unknown Source:1)
at live.studyquran.android.auth.ui.AuthNavGraphKt$AuthNavGraph$1$1.invoke(AuthNavGraph.kt:41)
at live.studyquran.android.auth.ui.AuthNavGraphKt$AuthNavGraph$1$1.invoke(AuthNavGraph.kt:15)
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:613)
at androidx.navigation.compose.NavHostKt$NavHost$32$1.invoke(NavHost.kt:611)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
2024-12-24 10:24:09.527 23374-23374 AndroidRuntime live.studyquran.android E at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:401) (Ask Gemini)
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:611)
at androidx.navigation.compose.NavHostKt$NavHost$32.invoke(NavHost.kt:594)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:139)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
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:571)
at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:317)
at live.studyquran.android.auth.ui.AuthNavGraphKt.AuthNavGraph(AuthNavGraph.kt:14)
at xyz.androidrey.multimoduletemplate.ui.ComposableSingletons$MainActivityKt$lambda-1$1.invoke(MainActivity.kt:41)
at xyz.androidrey.multimoduletemplate.ui.ComposableSingletons$MainActivityKt$lambda-1$1.invoke(MainActivity.kt:28)
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.material3.SurfaceKt$Surface$1.invoke(Surface.kt:126)
at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:108)
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.SurfaceKt.Surface-T9BRK9s(Surface.kt:105)
at xyz.androidrey.multimoduletemplate.ui.ComposableSingletons$MainActivityKt$lambda-2$1.invoke(MainActivity.kt:25)
at xyz.androidrey.multimoduletemplate.ui.ComposableSingletons$MainActivityKt$lambda-2$1.invoke(MainActivity.kt:24)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
2024-12-24 10:24:09.528 23374-23374 AndroidRuntime live.studyquran.android E at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:401) (Ask Gemini)
at androidx.compose.material3.TextKt.ProvideTextStyle(Text.kt:349)
at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:69)
at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:68)
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:60)
at xyz.androidrey.multimoduletemplate.theme.ThemeKt.AppTheme(Theme.kt:339)
at xyz.androidrey.multimoduletemplate.ui.ComposableSingletons$MainActivityKt$lambda-3$1.invoke(MainActivity.kt:24)
at xyz.androidrey.multimoduletemplate.ui.ComposableSingletons$MainActivityKt$lambda-3$1.invoke(MainActivity.kt:23)
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)
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:3595)
at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3522)
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)
2024-12-24 10:24:09.534 23374-23374 AndroidRuntime live.studyquran.android E at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:635) (Ask Gemini)
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:1631)
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:1712)
at android.view.View.dispatchAttachedToWindow(View.java:22895)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3506)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3513)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3513)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3513)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3513)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3515)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2977)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10429)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1424)
at android.view.Choreographer.doCallbacks(Choreographer.java:1024)
at android.view.Choreographer.doFrame(Choreographer.java:953)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1398)
at android.os.Handler.handleCallback(Handler.java:991)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8787)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:871)
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.ktor.client.plugins.contentnegotiation.ContentNegotiation" on path: DexPathList[[zip file "/data/app/~~dTXS5ZQl5IDDfbqaLXQ-0g==/live.studyquran.android-JMYC4L7W9RS1FF26nUG7uA==/base.apk"],nativeLibraryDirectories=[/data/app/~~dTXS5ZQl5IDDfbqaLXQ-0g==/live.studyquran.android-JMYC4L7W9RS1FF26nUG7uA==/lib/arm64, /data/app/~~dTXS5ZQl5IDDfbqaLXQ-0g==/live.studyquran.android-JMYC4L7W9RS1FF26nUG7uA==/base.apk!/lib/arm64-v8a, /system/lib64, /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)
... 150 more

@mirzemehdi
Copy link
Owner

mirzemehdi commented Jan 14, 2025

@sabbirreyjohn I guess it is because of ktor version Are u using ktor 2.x.x in your project? Bumping ktor to 3.0.0 should fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants