NoClassDefFoundError when running a search using a Hits view
See original GitHub issueI’m trying to integrate the code from your Android tutorial into my app. When running helper.search()
, the app crashes, failing to find a class def for “com.android.databinding.library.baseAdapters.DataBinderMapperImpl”.
My app uses Kotlin and AndroidX, if it makes any difference.
Do you want to request a feature or report a bug? Bug
Bug: What is the current behavior? Activity crashes with stack trace
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/databinding/library/baseAdapters/DataBinderMapperImpl;
at com.algolia.instantsearch.DataBinderMapperImpl.collectDependencies(DataBinderMapperImpl.java:71)
at androidx.databinding.MergedDataBinderMapper.addMapper(MergedDataBinderMapper.java:58)
at androidx.databinding.MergedDataBinderMapper.addMapper(MergedDataBinderMapper.java:60)
at androidx.databinding.DataBinderMapperImpl.<init>(DataBinderMapperImpl.java:5)
at androidx.databinding.DataBindingUtil.<clinit>(DataBindingUtil.java:32)
at androidx.databinding.DataBindingUtil.inflate(DataBindingUtil.java:95)
at com.algolia.instantsearch.ui.views.Hits$HitsAdapter.onCreateViewHolder(Hits.java:459)
at com.algolia.instantsearch.ui.views.Hits$HitsAdapter.onCreateViewHolder(Hits.java:424)
at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6794)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5975)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
at androidx.recyclerview.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1858)
at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5044)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1004)
at android.view.Choreographer.doCallbacks(Choreographer.java:816)
at android.view.Choreographer.doFrame(Choreographer.java:748)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:990)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.databinding.library.baseAdapters.DataBinderMapperImpl" on path
Bug: What is the expected behavior? Hits view loads with search results
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How can I solve "java.lang.NoClassDefFoundError"?
Show activity on this post. NoClassDefFoundError means that the class is present in the classpath at Compile time , but it doesn't exist...
Read more >How to Resolve the NoClassDefFoundError in Java
NoClassDefFoundError is a Java error that occurs when the JVM is unable to find a class at runtime which was available at compile-time....
Read more >Getting "Caused by: java.lang.NoClassDefFoundError: org/ ...
Hello Community,. I'm running into a problem when I submit a job in Hue editor, from Hue home page I navigate to Query...
Read more >Getting java.lang.NoClassDefFoundError for ...
I am following Getting Started for InstantSearch for Android. Getting following error in the Activity containing the InstantSearch codes: java.lang.
Read more >java.lang.NoClassDefFoundError on vCenter 6.0 u2a
Hi, A customer of ours is hitting the following error in their virgo logs on their Windows vCenter running 6.0 u2a. java.lang.Exception: A....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi again, thanks for starring the issue 🙂
We are going to release a new artifact refactored with
androidX
to unblock you until the bug is resolved. To avoid forcing our other customers to update, we’ll likely keepinstantsearch-android
onsupport.v7
while releasing a newinstantsearch-androidx
based onAndroidX
that you’ll be able to use in your projects.This situation with two different artifacts will be temporary, and will resolve as soon as:
jetifier
issue, allowing us to ship the initial support.v7 codebase for bothsupport.v7
users and AndroidX users like youWhen either one happens, we’ll delete the
instantsearch-androidx
artifacts and will be back to simply exposinginstantsearch-android
.Hi @sodle, thanks for your report and apologies for the hassle!
It is indeed due to AndroidX, it seems that the automatic migration tool has an issue with libraries depending on
android.databinding
which prevents using such libraries with AndroidX projects. I opened an issue on Google’s tracker, can you star it to show them you are affected which will help them prioritize this issue?We are soon going to release alternate artifacts for AndroidX until the bug is resolved on Google’s side. I’ll keep you updated here as soon as an AndroidX release is available!