gpt4 book ai didi

android - 致命异常 : main java. lang.ExceptionInInitializerError 由 : java. lang.NoClassDefFoundError : org. slf4j.LoggerFactory 引起

转载 作者:行者123 更新时间:2023-11-29 01:06:44 33 4
gpt4 key购买 nike

我想在我的应用程序中使用 Algolia 进行地理搜索。

当我将示例项目 ( icebnb ) 文件复制到我的项目时。

我已经在堆栈溢出助手的帮助下清除了即时搜索模块中的一些错误错误。

当我打开 Activity (运行时)时出现错误。

我正面临这个错误并且遭受了很长时间的痛苦。请帮助我。

09-27 14:44:57.244 29793-29793/com.google.tho.saw E/AndroidRuntime: FATAL EXCEPTION: main java.lang.ExceptionInInitializerError
at com.jayway.jsonpath.internal.ParseContextImpl.parse(ParseContextImpl.java:38)
at com.jayway.jsonpath.JsonPath.read(JsonPath.java:502)
at com.algolia.instantsearch.utils.JSONUtils.getObjectFromJSONPath(JSONUtils.java:40)
at com.algolia.instantsearch.utils.JSONUtils.getStringFromJSONPath(JSONUtils.java:22)
at com.algolia.instantsearch.ui.views.Hits$HitsAdapter.onBindViewHolder(Hits.java:458)
at com.algolia.instantsearch.ui.views.Hits$HitsAdapter.onBindViewHolder(Hits.java:398)
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6356)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6389)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5335)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5598)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5440)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5436)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2224)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1551)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1511)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:595)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3583)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3312)
at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1618)
at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4702)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
at android.view.Choreographer.doCallbacks(Choreographer.java:591)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5317)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)

Caused by: java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory

at com.jayway.jsonpath.internal.JsonContext.<clinit>(JsonContext.java:41)
at com.jayway.jsonpath.internal.ParseContextImpl.parse(ParseContextImpl.java:38) 
at com.jayway.jsonpath.JsonPath.read(JsonPath.java:502) 
at com.algolia.instantsearch.utils.JSONUtils.getObjectFromJSONPath(JSONUtils.java:40) 
at com.algolia.instantsearch.utils.JSONUtils.getStringFromJSONPath(JSONUtils.java:22) 
at com.algolia.instantsearch.ui.views.Hits$HitsAdapter.onBindViewHolder(Hits.java:458) 
at com.algolia.instantsearch.ui.views.Hits$HitsAdapter.onBindViewHolder(Hits.java:398) 
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6356) 
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6389) 
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5335) 
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5598) 
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5440) 
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5436) 
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2224) 
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1551) 
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1511) 
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:595) 
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3583) 
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3312) 
at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1618) 
at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4702) 
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791) 
at android.view.Choreographer.doCallbacks(Choreographer.java:591) 
at android.view.Choreographer.doFrame(Choreographer.java:560) 
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777) 
at android.os.Handler.handleCallback(Handler.java:725) 
at android.os.Handler.dispatchMessage(Handler.java:92) 
at android.os.Looper.loop(Looper.java:176) 
at android.app.ActivityThread.main(ActivityThread.java:5317) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:511) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 
at dalvik.system.NativeStart.main(Native Method) 

最佳答案

您缺少类 org.slf4j.LoggerFactory 的库。

尝试根据您的 app/build.gradle 文件添加以下内容。

compile 'org.slf4j:slf4j-api:1.7.24'
compile 'org.slf4j:slf4j-simple:1.7.24'

您还可以下载slf4j jar文件,然后包含在 app/build.gradle 中:

compile files('libs/slf4j.jar'); //You can change jar name here

关于android - 致命异常 : main java. lang.ExceptionInInitializerError 由 : java. lang.NoClassDefFoundError : org. slf4j.LoggerFactory 引起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46444470/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com