Совместимые версии для Algolia InstantSearch-Android, Firebase-UI, Glide

Я должен обеспечить полнотекстовый поиск по данным, хранящимся в Firebase. Поскольку Firebase не поддерживает полнотекстовый поиск, я использую Algolia InstantSearch-Android. Я использую библиотеку Glide для отображения изображений в приложении. Я не получаю ошибку во время компиляции, но следующая ошибка после выбора опции поиска.

java.lang.NoSuchMethodError: No virtual method into(Landroid/widget/ImageView;)Lcom/bumptech/glide/request/target/Target; in class Lcom/bumptech/glide/RequestBuilder; or its super classes (declaration of 'com.bumptech.glide.RequestBuilder' appears in /data/app/com.realtimesig.android.edjio-1/split_lib_dependencies_apk.apk)
                                                                                 at com.algolia.instantsearch.ui.views.Hits$HitsAdapter.onBindViewHolder(Hits.java:512)
                                                                                 at com.algolia.instantsearch.ui.views.Hits$HitsAdapter.onBindViewHolder(Hits.java:409)
                                                                                 at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6508)
                                                                                 at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6541)
                                                                                 at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5484)
                                                                                 at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5750)
                                                                                 at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5589)
                                                                                 at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5585)
                                                                                 at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2231)
                                                                                 at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1558)
                                                                                 at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1518)
                                                                                 at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:610)
                                                                                 at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3719)
                                                                                 at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3135)
                                                                                 at android.view.View.measure(View.java:19857)
                                                                                 at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
                                                                                 at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
                                                                                 at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
                                                                                 at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
                                                                                 at android.view.View.measure(View.java:19857)
                                                                                 at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
                                                                                 at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
                                                                                 at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
                                                                                 at android.view.View.measure(View.java:19857)
                                                                                 at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
                                                                                 at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:400)
                                                                                 at android.view.View.measure(View.java:19857)
                                                                                 at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
                                                                                 at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
                                                                                 at android.view.View.measure(View.java:19857)
                                                                                 at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
                                                                                 at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
                                                                                 at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
                                                                                 at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
                                                                                 at android.view.View.measure(View.java:19857)
                                                                                 at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
                                                                                 at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
                                                                                 at com.android.internal.policy.DecorView.onMeasure(DecorView.java:689)
                                                                                 at android.view.View.measure(View.java:19857)
                                                                                 at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2275)
                                                                                 at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1366)
                                                                                 at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1619)
                                                                                 at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
                                                                                 at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
                                                                                 at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
                                                                                 at android.view.Choreographer.doCallbacks(Choreographer.java:686)
                                                                                 at android.view.Choreographer.doFrame(Choreographer.java:621)
                                                                                 at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
02-15 22:50:39.145 3114-3114/com.realtimesig.android.edjio E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:751)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                 at android.os.Looper.loop(Looper.java:154)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Я проверил несколько похожих вопросов и сообщений, но не смог решить проблему. Согласно этим сообщениям, проблема в основном связана с несовпадающей версией Glide, используемой моим приложением, и Algolia InstantSearch-Android. Попытка изменить версии Glide и InstantSearch-Android безуспешно.

зависимости build.gradle

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
// For search functionality
implementation "com.algolia:instantsearch-android:1.4.2"

implementation 'com.firebaseui:firebase-ui-storage:3.2.1'
implementation 'com.firebaseui:firebase-ui-database:3.2.1'
implementation 'com.firebaseui:firebase-ui-auth:3.2.1'
implementation 'com.google.android.gms:play-services-auth:11.8.0'

// Required only if Twitter login support is required
compile("com.twitter.sdk.android:twitter-core:3.0.0@aar") { transitive = true }

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

1 ответ

Для тех, кто сталкивается с той же проблемой

Наконец нашли совместимые версии следующим образом:

FirebaseUI 3.1.2 и instantsearch-android 1.4.2 - оба используют Glide версии 4.3.1

Используя их, ошибка была удалена

Другие вопросы по тегам