Skip to content

[VertextAI] java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/plugins/HttpTimeoutCapability #6413

Closed as not planned
@658jjh

Description

@658jjh

Enviroment

  • Android Studio version: Android Studio Ladybug | 2024.2.1 Patch 1
  • Firebase Component: com.google.firebase:firebase-bom:33.5.1

Problem

I am encoutering when update ktor to 3.0.0,
I working if I downgrade ktor to version 2.x.x, after check VertextAI dependencies, I can see that we are using the version 2.3.2 so I think that was the problem

Relevant Code:

java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/plugins/HttpTimeoutCapability;
System.err               W  	at io.ktor.client.engine.okhttp.OkHttpEngine.<init>(OkHttpEngine.kt:31)
System.err               W  	at io.ktor.client.engine.okhttp.OkHttp.create(OkHttp.kt:31)
System.err               W  	at io.ktor.client.engine.HttpClientEngineFactory$DefaultImpls.create$default(HttpClientEngine.kt:117)
System.err               W  	at com.google.firebase.vertexai.common.APIController.<init>(APIController.kt:93)
System.err               W  	at com.google.firebase.vertexai.GenerativeModel.<init>(GenerativeModel.kt:84)
System.err               W  	at com.google.firebase.vertexai.FirebaseVertexAI.generativeModel(FirebaseVertexAI.kt:68)
System.err               W  	at com.google.firebase.vertexai.FirebaseVertexAI.generativeModel$default(FirebaseVertexAI.kt:56)
System.err               W  	at platform.VertexAiManager_androidKt.audioHandling(VertexAiManager.android.kt:23)
System.err               W  	at ui.main.root.MainRootComponent$onAudioSelected$1.invokeSuspend(MainRootComponent.kt:184)
System.err               W  	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
System.err               W  	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
System.err               W  	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
System.err               W  	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:832)
System.err               W  	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
System.err               W  	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
WindowOnBackDispatcher   W  OnBackInvokedCallback is not enabled for the application.
                            Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
System.err               W  Caused by: java.lang.ClassNotFoundException: Didn't find class "io.ktor.client.plugins.HttpTimeoutCapability" on path: DexPathList[[dex file "/data/data/com.mocy.moneytracker/code_cache/.overlay/base.apk/classes22.dex", zip file "/data/app/~~l3nsB4MBl8FXfRa7Q2KsyQ==/com.mocy.moneytracker-YDDe9i3I2Cz1HYIIO4n89Q==/base.apk"],nativeLibraryDirectories=[/data/app/~~l3nsB4MBl8FXfRa7Q2KsyQ==/com.mocy.moneytracker-YDDe9i3I2Cz1HYIIO4n89Q==/lib/arm64, /data/app/~~l3nsB4MBl8FXfRa7Q2KsyQ==/com.mocy.moneytracker-YDDe9i3I2Cz1HYIIO4n89Q==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
System.err               W  	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
System.err               W  	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
System.err               W  	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions