Я использую Gemini и Ktor для своего проекта. Когда я загружаю модель из Gemini, мое приложение бросает это исключение, хотя объект Gemini не называется: < / p > < b r / > < p r e c l a s s = " l a n g - n o n e p r e t t y p r i n t - o v e r r i d e " > < c o d e > j a v a . l a n g . r e f l e c t . I n v o c a t i o n T a r g e t E x c e p t i o n < b r / > a t j a v a . l a n g . r e f l e c t . C o n s t r u c t o r . n e w I n s t a n c e 0 ( N a t i v e M e t h o d ) < b r / > a t j a v a . l a n g . r e f l e c t . C o n s t r u c t o r . n e w I n s t a n c e ( C o n s t r u c t o r . j a v a : 3 4 3 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . i n t e r n a l . J v m V i e w M o d e l P r o v i d e r s . c r e a t e V i e w M o d e l ( J v m V i e w M o d e l P r o v i d e r s . k t : 3 8 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ N e w I n s t a n c e F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 1 9 3 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ A n d r o i d V i e w M o d e l F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 3 1 7 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ A n d r o i d V i e w M o d e l F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 2 9 9 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ A n d r o i d V i e w M o d e l F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 2 7 3 ) < b r / > a t a n d r o i d x . l i f e c y c l e . S a v e d S t a t e V i e w M o d e l F a c t o r y . c r e a t e ( S a v e d S t a t e V i e w M o d e l F a c t o r y . k t : 1 2 8 ) < b r / > a t d a g g e r . h i l t . a n d r o i d . i n t e r n a l . l i f e c y c l e . H i l t V i e w M o d e l F a c t o r y . c r e a t e ( H i l t V i e w M o d e l F a c t o r y . j a v a : 1 7 2 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 1 5 8 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . V i e w M o d e l P r o v i d e r I m p l _ a n d r o i d K t . c r e a t e V i e w M o d e l ( V i e w M o d e l P r o v i d e r I m p l . a n d r o i d . k t : 3 4 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . V i e w M o d e l P r o v i d e r I m p l . g e t V i e w M o d e l $ l i f e c y c l e _ v i e w m o d e l _ r e l e a s e ( V i e w M o d e l P r o v i d e r I m p l . k t : 6 5 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . V i e w M o d e l P r o v i d e r I m p l . g e t V i e w M o d e l $ l i f e c y c l e _ v i e w m o d e l _ r e l e a s e $ d e f a u l t ( V i e w M o d e l P r o v i d e r I m p l . k t : 4 7 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r . g e t ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 9 1 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t _ _ V i e w M o d e l K t . g e t ( V i e w M o d e l . k t : 1 6 2 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t . g e t ( U n k n o w n S o u r c e : 1 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t _ _ V i e w M o d e l _ a n d r o i d K t . v i e w M o d e l ( V i e w M o d e l . a n d r o i d . k t : 1 2 4 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t . v i e w M o d e l ( U n k n o w n S o u r c e : 1 ) < b r / > a t c o m . d a g . n e x w a l l e t . f e a t u r e s . c h a t . C h a t V i e w K t . C h a t S c r e e n ( C h a t V i e w . k t : 3 2 2 ) < b r / > a t c o m . d a g . n e x w a l l e t . b a s e . n a v i g a t i o n . C o m p o s a b l e S i n g l e t o n s $ D e f a u l t N a v i g a t i o n H o s t K t $ l a m b d a - 3 $ 1 . i n v o k e ( D e f a u l t N a v i g a t i o n H o s t . k t : 7 0 ) < b r / > a t c o m . d a g . n e x w a l l e t . b a s e . n a v i g a t i o n . C o m p o s a b l e S i n g l e t o n s $ D e f a u l t N a v i g a t i o n H o s t K t $ l a m b d a - 3 $ 1 . i n v o k e ( D e f a u l t N a v i g a t i o n H o s t . k t : 6 9 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 3 9 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 5 ) < b r / > a t a n d r o i d x . n a v i g a t i o n . c o m p o s e . N a v H o s t K t $ N a v H o s t $ 3 2 $ 1 . i n v o k e ( N a v H o s t . k t : 7 0 4 ) < b r / > a t a n d r o i d x . n a v i g a t i o n . c o m p o s e . N a v H o s t K t $ N a v H o s t $ 3 2 $ 1 . i n v o k e ( N a v H o s t . k t : 7 0 3 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 9 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 5 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . C o m p o s i t i o n L o c a l K t . C o m p o s i t i o n L o c a l P r o v i d e r ( C o m p o s i t i o n L o c a l . k t : 4 0 1 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . s a v e a b l e . S a v e a b l e S t a t e H o l d e r I m p l . S a v e a b l e S t a t e P r o v i d e r ( S a v e a b l e StateHolder.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:703)
at androidx.navigation.compose.NavHostKt$NavHost$32.invoke(NavHost.kt:683)
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:655)
at androidx.navigation.compose.NavHostKt$NavHost$34.invoke(Unknown Source:29)
at androidx.navigation.compose.NavHostKt$NavHost$34.invoke(Unknown Source:10)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:192)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2825)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:3116)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3607)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3552)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:948)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1206)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:132)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:616)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:585)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1299)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1309)
at android.view.Choreographer.doCallbacks(Choreographer.java:923)
at android.view.Choreographer.doFrame(Choreographer.java:847)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1283)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@eff8fcf, androidx.compose.ui.platform.MotionDurationScaleImpl@9bb7d5c, StandaloneCoroutine{Cancelling}@62e9865, AndroidUiDispatcher@763d93a]
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/plugins/HttpTimeout;
at io.ktor.client.engine.okhttp.OkHttpEngine.(OkHttpEngine.kt:40)
at io.ktor.client.engine.okhttp.OkHttp.create(OkHttp.kt:31)
at io.ktor.client.engine.HttpClientEngineFactory$DefaultImpls.create$default(HttpClientEngineFactory.kt:82)
at com.google.ai.client.generativeai.common.APIController.(APIController.kt:85)
at com.google.ai.client.generativeai.common.APIController.(APIController.kt:79)
at com.google.ai.client.generativeai.GenerativeModel.(GenerativeModel.kt:97)
at com.google.ai.client.generativeai.GenerativeModel.(GenerativeModel.kt:79)
at com.dag.nexwallet.features.chat.ChatVM.(ChatVM.kt:20)
... 81 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.ktor.client.plugins.HttpTimeout" on path: DexPathList[[zip file "/data/app/~~NRSJpgzmf_I3UfeMcT4rsg==/com.dag.nexwallet-Sq-6nPCFXHiDoLqK-_gONw==/base.apk"],nativeLibraryDirectories=[/data/app/~~NRSJpgzmf_I3UfeMcT4rsg==/com.dag.nexwallet-Sq-6nPCFXHiDoLqK-_gONw==/lib/arm64, /data/app/~~NRSJpgzmf_I3UfeMcT4rsg==/com.dag.nexwallet-Sq-6nPCFXHiDoLqK-_gONw==/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)
... 89 more
< /code>
Также я называю модель таким образом: < /p>
private val generativeModel = GenerativeModel(
modelName = "gemini-pro",
apiKey = BuildConfig.API_KEY
)
< /code>
Моя версия KTOR - 3.1.2. и версия пакета Generativeai - 0.9.0.
Как мне решить эту проблему?
Подробнее здесь: https://stackoverflow.com/questions/796 ... lugins-htt
Как исправить classnotfoundexception: не нашел класс "io.ktor.client.plugins.httptimeout"? ⇐ Android
Форум для тех, кто программирует под Android
1746148783
Anonymous
Я использую Gemini и Ktor для своего проекта. Когда я загружаю модель из Gemini, мое приложение бросает это исключение, хотя объект Gemini не называется: < / p > < b r / > < p r e c l a s s = " l a n g - n o n e p r e t t y p r i n t - o v e r r i d e " > < c o d e > j a v a . l a n g . r e f l e c t . I n v o c a t i o n T a r g e t E x c e p t i o n < b r / > a t j a v a . l a n g . r e f l e c t . C o n s t r u c t o r . n e w I n s t a n c e 0 ( N a t i v e M e t h o d ) < b r / > a t j a v a . l a n g . r e f l e c t . C o n s t r u c t o r . n e w I n s t a n c e ( C o n s t r u c t o r . j a v a : 3 4 3 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . i n t e r n a l . J v m V i e w M o d e l P r o v i d e r s . c r e a t e V i e w M o d e l ( J v m V i e w M o d e l P r o v i d e r s . k t : 3 8 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ N e w I n s t a n c e F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 1 9 3 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ A n d r o i d V i e w M o d e l F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 3 1 7 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ A n d r o i d V i e w M o d e l F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 2 9 9 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ A n d r o i d V i e w M o d e l F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 2 7 3 ) < b r / > a t a n d r o i d x . l i f e c y c l e . S a v e d S t a t e V i e w M o d e l F a c t o r y . c r e a t e ( S a v e d S t a t e V i e w M o d e l F a c t o r y . k t : 1 2 8 ) < b r / > a t d a g g e r . h i l t . a n d r o i d . i n t e r n a l . l i f e c y c l e . H i l t V i e w M o d e l F a c t o r y . c r e a t e ( H i l t V i e w M o d e l F a c t o r y . j a v a : 1 7 2 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r $ F a c t o r y . c r e a t e ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 1 5 8 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . V i e w M o d e l P r o v i d e r I m p l _ a n d r o i d K t . c r e a t e V i e w M o d e l ( V i e w M o d e l P r o v i d e r I m p l . a n d r o i d . k t : 3 4 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . V i e w M o d e l P r o v i d e r I m p l . g e t V i e w M o d e l $ l i f e c y c l e _ v i e w m o d e l _ r e l e a s e ( V i e w M o d e l P r o v i d e r I m p l . k t : 6 5 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . V i e w M o d e l P r o v i d e r I m p l . g e t V i e w M o d e l $ l i f e c y c l e _ v i e w m o d e l _ r e l e a s e $ d e f a u l t ( V i e w M o d e l P r o v i d e r I m p l . k t : 4 7 ) < b r / > a t a n d r o i d x . l i f e c y c l e . V i e w M o d e l P r o v i d e r . g e t ( V i e w M o d e l P r o v i d e r . a n d r o i d . k t : 9 1 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t _ _ V i e w M o d e l K t . g e t ( V i e w M o d e l . k t : 1 6 2 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t . g e t ( U n k n o w n S o u r c e : 1 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t _ _ V i e w M o d e l _ a n d r o i d K t . v i e w M o d e l ( V i e w M o d e l . a n d r o i d . k t : 1 2 4 ) < b r / > a t a n d r o i d x . l i f e c y c l e . v i e w m o d e l . c o m p o s e . V i e w M o d e l K t . v i e w M o d e l ( U n k n o w n S o u r c e : 1 ) < b r / > a t c o m . d a g . n e x w a l l e t . f e a t u r e s . c h a t . C h a t V i e w K t . C h a t S c r e e n ( C h a t V i e w . k t : 3 2 2 ) < b r / > a t c o m . d a g . n e x w a l l e t . b a s e . n a v i g a t i o n . C o m p o s a b l e S i n g l e t o n s $ D e f a u l t N a v i g a t i o n H o s t K t $ l a m b d a - 3 $ 1 . i n v o k e ( D e f a u l t N a v i g a t i o n H o s t . k t : 7 0 ) < b r / > a t c o m . d a g . n e x w a l l e t . b a s e . n a v i g a t i o n . C o m p o s a b l e S i n g l e t o n s $ D e f a u l t N a v i g a t i o n H o s t K t $ l a m b d a - 3 $ 1 . i n v o k e ( D e f a u l t N a v i g a t i o n H o s t . k t : 6 9 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 3 9 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 5 ) < b r / > a t a n d r o i d x . n a v i g a t i o n . c o m p o s e . N a v H o s t K t $ N a v H o s t $ 3 2 $ 1 . i n v o k e ( N a v H o s t . k t : 7 0 4 ) < b r / > a t a n d r o i d x . n a v i g a t i o n . c o m p o s e . N a v H o s t K t $ N a v H o s t $ 3 2 $ 1 . i n v o k e ( N a v H o s t . k t : 7 0 3 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 1 0 9 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . i n t e r n a l . C o m p o s a b l e L a m b d a I m p l . i n v o k e ( C o m p o s a b l e L a m b d a . j v m . k t : 3 5 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . C o m p o s i t i o n L o c a l K t . C o m p o s i t i o n L o c a l P r o v i d e r ( C o m p o s i t i o n L o c a l . k t : 4 0 1 ) < b r / > a t a n d r o i d x . c o m p o s e . r u n t i m e . s a v e a b l e . S a v e a b l e S t a t e H o l d e r I m p l . S a v e a b l e S t a t e P r o v i d e r ( S a v e a b l e StateHolder.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:703)
at androidx.navigation.compose.NavHostKt$NavHost$32.invoke(NavHost.kt:683)
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:655)
at androidx.navigation.compose.NavHostKt$NavHost$34.invoke(Unknown Source:29)
at androidx.navigation.compose.NavHostKt$NavHost$34.invoke(Unknown Source:10)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:192)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2825)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:3116)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3607)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3552)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:948)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1206)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:132)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:616)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:585)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1299)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1309)
at android.view.Choreographer.doCallbacks(Choreographer.java:923)
at android.view.Choreographer.doFrame(Choreographer.java:847)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1283)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@eff8fcf, androidx.compose.ui.platform.MotionDurationScaleImpl@9bb7d5c, StandaloneCoroutine{Cancelling}@62e9865, AndroidUiDispatcher@763d93a]
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/plugins/HttpTimeout;
at io.ktor.client.engine.okhttp.OkHttpEngine.(OkHttpEngine.kt:40)
at io.ktor.client.engine.okhttp.OkHttp.create(OkHttp.kt:31)
at io.ktor.client.engine.HttpClientEngineFactory$DefaultImpls.create$default(HttpClientEngineFactory.kt:82)
at com.google.ai.client.generativeai.common.APIController.(APIController.kt:85)
at com.google.ai.client.generativeai.common.APIController.(APIController.kt:79)
at com.google.ai.client.generativeai.GenerativeModel.(GenerativeModel.kt:97)
at com.google.ai.client.generativeai.GenerativeModel.(GenerativeModel.kt:79)
at com.dag.nexwallet.features.chat.ChatVM.(ChatVM.kt:20)
... 81 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.ktor.client.plugins.HttpTimeout" on path: DexPathList[[zip file "/data/app/~~NRSJpgzmf_I3UfeMcT4rsg==/com.dag.nexwallet-Sq-6nPCFXHiDoLqK-_gONw==/base.apk"],nativeLibraryDirectories=[/data/app/~~NRSJpgzmf_I3UfeMcT4rsg==/com.dag.nexwallet-Sq-6nPCFXHiDoLqK-_gONw==/lib/arm64, /data/app/~~NRSJpgzmf_I3UfeMcT4rsg==/com.dag.nexwallet-Sq-6nPCFXHiDoLqK-_gONw==/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)
... 89 more
< /code>
Также я называю модель таким образом: < /p>
private val generativeModel = GenerativeModel(
modelName = "gemini-pro",
apiKey = BuildConfig.API_KEY
)
< /code>
Моя версия KTOR - 3.1.2. и версия пакета Generativeai - 0.9.0.
Как мне решить эту проблему?
Подробнее здесь: [url]https://stackoverflow.com/questions/79602706/how-to-fix-classnotfoundexception-didnt-find-class-io-ktor-client-plugins-htt[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия