Unresolved reference "Searcher" - android

Trying to integrate instant search in my Android app, but "Searcher" is unresolved.
I have the following dependencies currently, am I missing any?
implementation "com.algolia:algoliasearch-android:3.27.0"
implementation "com.algolia:algoliasearch-client-kotlin-jvm:1.0.0"
implementation 'com.algolia:instantsearch-androidx:1.15.2'
implementation "io.ktor:ktor-client-android:1.2.2"

include core dependency also
implementation 'com.algolia:instantsearch-androidx-core:1.15.2'

The latest release of instantsearch-androidx is lacking its transitive dependencies. The issue was reported on GitHub, you can follow its progress there - likely a new version will soon be released with the appropriate dependencies packaged.
As a workaround, you can add the dependencies yourself to your application - depending on the InstantSearch features you use, you might need some or all of the following:
implementation "com.algolia:instantsearch-androidx:$VERSION_INSTANTSEARCH"
implementation "com.algolia:instantsearch-androidx-core:$VERSION_INSTANTSEARCH"
implementation 'com.algolia:algoliasearch-android:3.27.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'

Related

Android Gradle Libraries Conflict

I'm trying to implement Firebase dynamic links in an application that already uses Firebase, but once I added the needed libraries for dynamic links I started receiving this error:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[19.0.
2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
these are the old dependencies related to Firebase that were previously used in the app:
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.firebase:firebase-ml-vision:24.0.1'
and these are the new ones I'm trying to add:
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:26.0.0')
// Declare the dependencies for the Dynamic Links and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-dynamic-links-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
I'm not sure which dependency the error is referring to that need to be updated.
If you're going to use the Firebase BoM:
implementation platform('com.google.firebase:firebase-bom:26.0.0')
you should specify all of your Firebase depedencies without version numbers, and let the BoM assign them, so that they are all compatible with each other. This means stripping off the version numbers for the dependencies you added for FCM and others:
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-database'
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-ml-vision'
I don't know about 'com.google.android.gms:play-services-auth:17.0.0' - you might have to make sure that one is manually up to date to the latest version.

Firebase version update issue

I'm trying to update my firebase id & firebase messaging version but it gives me error
implementation "com.google.firebase:firebase-core:17.0.0"
implementation "com.google.firebase:firebase-iid:17.0.2"
implementation "com.google.firebase:firebase-messaging:17.0.0"
implementation "com.google.android.gms:play-services-places:17.0.0"
implementation "com.google.android.gms:play-services-location:17.0.0"
implementation "com.google.android.gms:play-services-maps:17.0.0"
Dependency failing: com.google.firebase:firebase-messaging:17.0.0 -> com.google.firebase:firebase-iid#[16.0.0], but fire
base-iid version was 19.0.0.
Also giving following errors:
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'mifosng' depends on project 'debugCompileClasspath' which depends onto com.google.firebase:firebase-analytic
s#17.0.0
-- Project 'mifosng' depends on project 'debugCompileClasspath' which depends onto com.google.firebase:firebase-core#17.
0.0
-- Project 'mifosng' depends on project 'debugCompileClasspath' which depends onto com.google.firebase:firebase-messagin
g#17.0.0
This happened to me before, You need to add/enable AndroidX in your project
Do not forget to add these in your Project properties:
android.useAndroidX=true
android.enableJetifier=true
This work for me :
implementation 'com.google.firebase:firebase-iid:19.0.1'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-database:18.0.0'
implementation 'com.google.firebase:firebase-auth:18.1.0'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
And
classpath 'com.google.gms:google-services:4.3.0'
in dependencies of the top level build.gradle
You dont need to add:
implementation "com.google.firebase:firebase-iid:17.0.2"
As it is a transitive dependency used in firebase-messaging which means firebase-messaging already uses it. So just remove implementation "com.google.firebase:firebase-iid:17.0.2" from your build.gradle file.

Classes using methods of other dependencies is not working in my custom library, any suggestions?

I have created by own library for helper methods & classes also included few other dependencies, then used the jitpack to create a custom dependency. But after implementing it to a project, the classes using the other dependencies are not visible to android studio.
I tried adding the other specific dependencies to the project and it works but I need to find alternative way without the need of adding specific dependencies. If it is possible, please do help.
My Library: My-Utility
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.android.gms:play-services-location:16.0.0'
If you are expecting any of those implementation dependencies to be automatically visible to apps using your library, replace implementation with api.
See the documentation for more.

connection to firebase auth appcompat-v7:28.0.0 Error

When I connect to Firebase Auth I got error in dependencies check this screen shot. How to fix this error?
You need to override the clashing support libraries by adding the conflicted libraries explicitly in your dependencies block.
dependencies {
implementation "com.android.support:support-media-compat:28.0.0"
implementation "com.android.support:animated-vector-drawable:28.0.0"
}
or you can use the whole support-v4 library which is include all the above libraries:
dependencies {
implementation "com.android.support:support-v4:28.0.0"
}
The message is self explanatory, you are using different versions for each of the following.
implementation 'com.android.support:support-media-compat:26.1.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
Change any one to match another, usually upgrading is better choice.

Android Studio 3.1: mixing versions can lead to runtime crashes

Have recently upgraded to Android Studio 3.1, and at the same time I'm trying the Android P preview.
I'm getting the following error on compiling:
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0-alpha1, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0-alpha1 and com.android.support:support-media-compat:26.1.0 less... (Ctrl+F1)
There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).
But I cannot see any instance of 26.1.0 anywhere. All I have in my gradle is:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-alpha1'
I've tried clearing caches, rebuilding app, etc. But error remains.
You need to override the conflicted libraries by adding the conflicted libraries to your dependencies block
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:customtabs:28.0.0-alpha1'
implementation 'com.android.support:support-vector-drawable:28.0.0-alpha1'
implementation 'com.android.support:support-media-compat:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
The above warning is not specific to media-compat dependency. They just added example to explain the issue. The issue get resolved by adding v4 lib for me.
implementation 'com.android.support:support-v4:28.0.0'
in addition to
implementation 'com.android.support:appcompat-v7:28.0.0'
No need include
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
You need to override the conflicted libraries by adding the conflicted libraries to your dependencies block. For example, from your error log you'll find the following:
Found versions 28.0.0-alpha1, 26.1.0. Examples include
com.android.support:animated-vector-drawable:28.0.0-alpha1 and
com.android.support:support-media-compat:26.1.0 less...
You can remove the error by adding the libraries with something like this:
dependencies {
implementation 'com.android.support:animated-vector-drawable:28.0.0-alpha1`
implementation 'com.android.support:support-media-compat:28.0.0-alpha1`
}
this error came,when i connect app to firebase.
no need to add any thing.
just put mouse cursor on error line(below one) and press Alt+Enter
(implementation 'com.android.support:appcompat-v7:28.0.0')
in the list enter first option.(noinspection)
After that it looks like this,
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
Some dependency — perhaps playLicensing — has a transitive dependency on at least support-media-compat, for version 26.1.0.
To work around this:
Identify each Support Library artifact that shows up in "External Libraries" that is older than 28.0.0-alpha1. Based on the error, those older ones should all be 26.1.0, and it will be at least support-media-compat.
For each of those, add your own implementation line to your dependencies, requesting that artifact, but for 28.0.0-alpha1. This will cause Gradle to use the newer artifact, which happens to be what you want.
Hope that whatever is depending on those older artifacts will survive with the newer artifacts.
So, at minimum, you are adding:
implementation 'com.android.support:support-media-compat:28.0.0-alpha1'
In my case I resolved it by adding this below the error line.
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
add in dependencies of build.grad (Module.app)
dependencies {
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
}
In my case adding support-v4 helped me to got loose of warning.
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
// other dependencies
}
Are you using a firebase in your project?
Using firebase core or firebase app indexing seem to be causing the problem.
I was having the same problem, but commenting on firebase packages makes the error to go away
// implementation 'com.google.firebase:firebase-core:16.0.8'
// implementation 'com.google.firebase:firebase-ads:17.2.0'
// implementation 'com.google.firebase:firebase-appindexing:17.1.0'
I think your gradle file has the below dependency. Add this to your app level build.gradle.
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:mediarouter-v7:28.0.0-alpha1'
implementation 'com.android.support:support-vector-drawable:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'

Categories

Resources