admin管理员组文章数量:1124691
I want to add VertexAI from firebase to my Android project. I have an existing Firebase project where I have followed and completed all the steps to enable vertexAi.
I have imported firebase dependencies:
implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
implementation("com.google.firebase:firebase-vertexai")
When even I call val gemini = Firebase.vertexAI.generativeModel("gemini-1.5-flash")
I get an error during runtime java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/plugins/HttpTimeout;
Yes its true, I have an other library, which is using io.ktor:ktor-client-android:3.0.2
so I have that included in my dependencies as well. I tried adding other ktor such as plugins, core ec... but always getting the same error.
I have tried to remove the orher library and clean/build with just firebase and vertex and still getting the same error.
When I run the vertex sample app it is working without any problem. I have tried to compare to the last symbol what are the differences between sample app and my app and found non related to ktor.
Where ever I look, everybody mentions, vertex ai on firebase is using ktor. But when I log app:dependencies
I don't see it in the tree under firebase. I found a github issue mentioning to downgrade ktor to 2.x.x, which I did and same result.
I there some funny little thing I have to include in my project, which would help me resolve this issue? Is there some totally out of context plugin/library, which I need to include resolve?
Exception at when using ktor 3.0.2:
java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/plugins/HttpTimeout;
at com.google.firebase.vertexaimon.APIController$client$1.invoke(APIController.kt:101)
Exception at when using ktor 2.3.2:
java.lang.NoClassDefFoundError: Failed resolution of: Lio/ktor/client/plugins/HttpTimeout;
at io.ktor.client.engine.okhttp.OkHttpEngine.<init>(OkHttpEngine.kt:40)
at io.ktor.client.engine.okhttp.OkHttp.create(OkHttp.kt:31)
...which is calling HttpTimeout, which I have no problem using in my app code. Exception is always thrown inside vertexai.
本文标签: firebaseProblem calling vertexAI model creation in android appStack Overflow
版权声明:本文标题:firebase - Problem calling vertexAI model creation in android app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736644625a1946074.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论