My gradle file is not throwing any error while building. But, when I run Android lint, it fails with incompatible gradle version error.
Sharing the error:
Incompatible Gradle Versions
../../build.gradle: All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 16.0.2, 16.0.1, 16.0.0, 15.1.0, 15.0.1. Examples include com.google.android.gms:play-services-measurement-base:16.0.2 and com.google.android.gms:play-services-measurement-api:16.0.1**
Sharing the google dependencies defined in app level gradle:
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support:gridlayout-v7:27.1.1'
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:recyclerview-v7:27.1.1'
compile 'com.android.support:cardview-v7:27.1.1'
compile 'com.android.support:preference-v14:27.1.1'
compile 'com.android.support:support-annotations:27.1.1'
compile 'com.android.support.constraint:constraint-layout:1.1.3'
compile 'com.google.android.gms:play-services-location:15.0.1'
compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-analytics:16.0.0'
compile 'com.google.android.gms:play-services-auth:16.0.0'
compile 'com.google.firebase:firebase-core:16.0.3'
compile 'com.google.firebase:firebase-messaging:17.3.0'
compile 'com.google.code.gson:gson:2.8.2'
Project level gradle file:
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:1.5.0'
Which dependency making this lint error? How to solve this gradle incompatibility issue?
I have tried changing all google gms versions to 15, but it didn't solved the issue..
compile 'com.google.android.gms:play-services-location:15.0.1'
compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-analytics:15.0.2'
compile 'com.google.android.gms:play-services-auth:15.0.1'
It happens because you are using an old plugin
classpath 'com.google.gms:google-services:1.5.0'
and different versions of the Google Services libraries.
You should update the Google Services Gradle Plugin:
dependencies {
classpath 'com.google.gms:google-services:4.2.0'
// ...
}
Then update your dependencies but it not necessary to use the same version.
Starting from plugin 3.3.0 there is a different behaviour:
Google Play services libraries after 15.0.0 now have independent
version numbers which follow SemVer. This change will allow for more
frequent, flexible updates by individual components. The Google
Services Gradle plugin has been updated to version 3.3.0 to support
this change in versioning.
Check also the documentation:
REMOVE THIS OLD PATTERN:
buildscript {
ext {
play_version = '15.0.0'
}
}
dependencies {
// DON’T DO THIS!!
// The following use of the above buildscript property is no longer valid.
implementation "com.google.android.gms:play-services-ads:${play_version}"
implementation "com.google.android.gms:play-services-auth:${play_version}"
implementation "com.google.firebase:firebase-firestore:${play_version}"
}
Now each dependency that you use may now be at different versions.
You need to update gradle build tools to this version:-
classpath 'com.android.tools.build:gradle:3.2.1'
and google play services
classpath 'com.google.gms:google-services:3.2.0'
The error message
All com.google.android.gms libraries must use the exact same version
specification (mixing versions can lead to runtime crashes). Found
versions 16.0.2, 16.0.1, 16.0.0, 15.1.0, 15.0.1.
is very clearly telling that
This is what you have right now:
compile 'com.google.android.gms:play-services-location:15.0.1'
compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-analytics:16.0.0'
it must be:
compile 'com.google.android.gms:play-services-location:16.0.2'
compile 'com.google.android.gms:play-services-maps:16.0.2'
compile 'com.google.android.gms:play-services-analytics:16.0.2'
Also, try to always use the latest version of Google APIs.
Hope this will help you.
adding to #Nouman Ch answer , These are the latest dependencies
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.6'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
check here and here for finding latest versions
Go to project view of android studio. There in .idea> libraries you'll find libraries with versions 16.0.2, 16.0.1, 16.0.0, 15.1.0, 15.0.1.
These libraries are imported as dependencies of the ones you have in your build.gradle file. Import the latest versions of those libraries in your dependencies to remove the error.
Related
When I start my flutter app, Im getting 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.
My dependencies in build gradle:
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-basement:17.4.0'
implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
implementation 'com.google.firebase:firebase-perf:19.0.10'
implementation 'com.google.firebase:firebase-database'
}
apply plugin: 'com.google.gms.google-services'
Please help me) Thanks in advance
To prevent versioning conflicts between Firebase SDKs, I recommend using the Firebase Bill of Materials (BoM) to manage the versions.
With the BoM, you'd have the following dependencies for Firebase:
dependencies {
implementation platform('com.google.firebase:firebase-bom:26.2.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.firebase:firebase-database'
}
So as you can see, the only version we specify is for the Bill of Materials itself This in turn then specifies the (compatible) versions of the specific product SDKs.
I am getting this error when updating the Firebase libraries:
The library com.google.firebase:firebase-analytics is being requested
by various other libraries at [[15.0.1,16.0.0), [16.0.1,16.0.1],
[16.0.1,99999]], but resolves to 16.0.1. Disable the plugin and check
your dependencies tree using ./gradlew :app:dependencies.
Dependencies are:
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-invites:16.0.1'
implementation 'com.google.firebase:firebase-config:16.0.0'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.2'
Is there a simple way to find the correct configuration?
If not, what plugin is to be disabled and how? if i just run the task i get the same error.
Update:
i think this dependency has something to do it with, because if disable it's pluging the depedency task runs:
implementation 'com.google.android.gms:play-services-auth:15.0.1'
Try using these steps:
Update your implementation versions (for the newest firebase versions see the release notes https://firebase.google.com/support/release-notes/android)
Update your project build.gradle file with the newest google-services version (at the moment classpath 'com.google.gms:google-services:4.0.1)
Or see this similar post
Situation
Today, after touching nothing of the project, my gradle yelled at me and wouldn't compile the project. It failed to resolve firebase-iid, firebase-common, play-services-analytics-impl, play-services-auth-api-phone, and play-services-auth-base. So quite a mess after the weekend.
So I checked the versions of the different APIs, and upgraded the ones that needed upgrading, found out that Google had added a mandatory dependency to firebase-core, added it, then upgraded my google-services plugin, and even added a play-services-base dependency. I also upgraded firebase-messaging to version 17.0.0, and crashlytics to version 2.9.3.
But still, the build doesn't compile, with this error message:
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.2,15.0.2], [15.0.4,15.0.4]], but resolves to 15.0.4. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Gradle Files
Here is my Gradle file (showing dependencies part only), after my attempted fixes:
apply plugin: 'com.android.application'
...
dependencies {
implementation project(':library')
implementation project(':otherlibrary')
implementation 'com.android.volley:volley:1.1.0'
implementation('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.android.gms:play-services-analytics:15.0.2'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation('com.google.android.gms:play-services-ads:15.0.1') {
exclude group: 'com.android.support', module: 'customtabs'
}
implementation 'com.google.android.gms:play-services-identity:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-drive:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:support-v13:27.1.1'
// https://mvnrepository.com/artifact/com.darwinsys/hirondelle-date4j
implementation group: 'com.darwinsys', name: 'hirondelle-date4j', version: '1.5.1'
// For RxAndroid and RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
// (see https://github.com/ReactiveX/RxJava/releases for latest 2.x.x version)
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
// Crashlytics
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.3'
// CSV with outputstream writer
implementation 'com.opencsv:opencsv:4.1'
// Gson
implementation 'com.google.code.gson:gson:2.8.5'
debugImplementation 'com.android.support.test:runner:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
androidTestImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
And my project-wide gradle contain these lines:
...
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
...
}
dependencies {
...
classpath 'com.google.gms:google-services:4.0.1'
}
...
Official solution doesn't work
I already tried to fix the version number of multiple libraries according to the official firebase documentation, which is more or less the same as this question.
As you can read in the official documentation link, as of May 2nd, 2018, they offered a way to fix this kind of issue, but the numbers of the versions in question are not the same, and I already tried the given fix (with some downgrades now), to no avail.
Official documentation:
If your app has a dependency on com.google.firebase:firebase-core:15.0.0 as well as any of the following libraries:
com.google.android.gms:play-services-analytics
com.google.android.gms:play-services-appinvite
com.google.android.gms:play-services-tagmanager
com.google.firebase:firebase-analytics
com.google.firebase:firebase-crash
com.google.firebase:firebase-dynamic-links
com.google.firebase:firebase-messaging
You will need to update the version of the latter dependency to
15.0.2. This addresses the issue where version 3.3.0 of the Google Services Gradle plugin reports: The library
com.google.android.gms:play-services-measurement-base is being
requested by various other libraries at [[15.0.0,15.0.0],
[15.0.2,15.0.2]], but resolves to 15.0.2...
So how can I resolve these conflicts of versions in order for my build to compile once again correctly?
So after a day lost in this issue, I found out that the latest version of play-services-analytics is not the one they have published in their website. It is 16.0.0 and not 15.0.2.
Android Studio told that to a colleague as a warning, but mine was unconcerned about it. So here it is, the line that changes everything:
implementation 'com.google.android.gms:play-services-analytics:16.0.0'
I added this to my build.gradle (application version) and it worked:
googleServices { disableVersionCheck = true }
(Keep in mind that this is just to disable the version check, it does not actually fix anything)
I tried reverting back to an old build, and it seemed to work, what i found was that the gradle-wrapper.properties was using and older version (4.5) instead of the 4.6 i had in the newer project. Changing this as well as reverting to classpath 'com.android.tools.build:gradle:3.2.0-alpha08' from alpha15 seemed to do the trick. I think you can use the alpha 15 if you like, but to be sure you can use the classpath 'com.android.tools.build:gradle:3.1.2'.
Along with all these changes the firebase-core and the google-gms-services should be set to version 16.0.0.
Unfortunately google play service has been stopped
This widows msg are generated &never run any google service performs
I've searched for a lot of solutions to this, but none fit my exact case. I am getting this error on Gradle Sync:
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.
this is in my build.gradle (app) dependencies.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
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'
}
and this is in my Project level build.gradle
buildscript {
ext.kotlin_version = '1.2.10'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.1.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Also Important:
It shows a red line under this line:
implementation 'com.google.firebase:firebase-auth:11.8.0'
The message I'm getting if I hover over it:
All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 11.8.0, 11.4.2. Examples include com.google.android.gms:play-services-auth:11.8.0 and com.google.firebase:firebase-analytics:11.4.2
I don't even have an analytics dependency!
What do I do?
Already tried solutions:
If I try to change my com.google.android.gms version, it will throw me a lint saying not to bundle my entire play services in the dependencies. And it also doesn't change the firebase error I'm getting.
Changing firebase to 11.4.2 will throw a lint error.
Changing google play services version to 3.1.1 or below will do nothing.
If I am not wrong, Google services have the dependency on the firebase. I think both are conflicting
check this firebase.google.com/docs/android/setup and adjust google services and firebase dependency versions
Also, make sure you have this at the bottom of your build.gradle (app) file:
apply plugin: 'com.google.gms.google-services'
You might have some third party library in your project using the com.google.firebase:firebase-analytics:11.4.2 version of Analytics. Try to find that.
Try changing it from 11.8.0 to 11.4.2 works for me.
old values
implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
new values
implementation 'com.google.firebase:firebase-firestore:11.4.2'
implementation 'com.google.firebase:firebase-auth:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
change this
implementation 'com.google.firebase:firebase-auth:11.8.0'
to
compile'com.google.firebase:firebase-auth:11.8.0'
and make sure that in your applevel build.gradle all google and firebase dependency version should be the same.
it doesnt works try removing google dependency from applevel build.gradle
I am using Fragment for the designing of the Firebase simple login registration.
I get error in the OnCreateView() method on initializing
auth = FirebaseAuth.getInstance();
error:- Error:(58, 28) error: cannot access zzaja
class file for com.google.android.gms.internal.zzaja not found
please help
source:- http://www.androidhive.info/2016/06/android-getting-started-firebase-simple-login-registration-auth/
I solved this exact problem today and stumbled onto this unanswered question by chance during the process.
First, ensure you've properly setup Firebase for Android as documented here: https://firebase.google.com/docs/android/setup. Then, make sure you are compiling the latest version of the Firebase APIs (9.2.0) and the Google Play Services APIs (9.2.0) that you are using. My gradle dependencies look something like this:
dependencies {
...
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-auth:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
}
Hope this helps!
I had such a similar error when i was recently upgrading my play service dependency. It seems to occur when you leave out updating the firebase dependencies that correspond to the version of play services you use. I beleive this is the most recent update of these dependencies
Here is what the two versions of my dependencies were:
Error version of dependencies
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.google.firebase:firebase-auth:9.8.0'
compile 'com.google.firebase:firebase-database:9.8.0'
compile 'com.firebaseui:firebase-ui-database:1.0.1'
compile 'com.google.firebase:firebase-storage:9.8.0'
Working version of dependencies
``
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.0'
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui-database:1.0.1'
compile 'com.google.firebase:firebase-storage:10.0.0'
``
Google seems to move play service updates along with firebase updates these days. Hopes this saves a few souls out there.
If you use different version of play services libraries, you will get this error.
For example, below entries in build.gradle file cause the error as versions are different.
implementation 'com.google.android.gms:play-services-maps:11.4.2'
implementation 'com.google.android.gms:play-services-location:11.6.0'
To fix the issue use same versions.
implementation 'com.google.android.gms:play-services-maps:11.6.0'
implementation 'com.google.android.gms:play-services-location:11.6.0'
All your firebase version should be with same Version whatever it
like this
compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-database:9.0.0'
compile 'com.google.firebase:firebase-auth:9.0.0'
compile 'com.google.firebase:firebase-messaging:9.0.0'
Well, the short answer is: update your library version. Android studio will tell you that there is a new version of it with a message like:
A newer version of com.google.firebase:firebase-core than 14.0.4 is
available: 16.0.4
Just move to that line, press Alt + Enter and select Change to X.X where X.X is the newer version.
This way, you can update all your libraries. Repeat the process with all the libraries and you are done.
If you are using more than one libraries of firebase then make sure that the version are same.
Before:
compile 'com.google.firebase:firebase-database:9.2.0'
compile 'com.google.firebase:firebase-storage:9.2.0'
compile 'com.firebaseui:firebase-ui-database:0.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-auth:9.0.2'
After: compile 'com.google.firebase:firebase-database:9.2.0'
compile 'com.google.firebase:firebase-storage:9.2.0'
compile 'com.firebaseui:firebase-ui-database:0.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-auth:9.2.0'
in my case i have used auth with 9.0.2 .So i changed to 9.2.0
I solved the problem in june of 2017 changing the play-services versions for the latest firebase versions (9.6.1). When I used the latest play-services version (10.2.4) I got that error. The code in the gradle looks like this:
Before
compile 'com.google.android.gms:play-services-maps:10.2.4'
compile 'com.google.android.gms:play-services-places:10.2.4'
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-auth:9.6.1'
After
compile 'com.google.android.gms:play-services-maps:9.6.1'
compile 'com.google.android.gms:play-services-places:9.6.1'
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-auth:9.6.1'
play services, firebase, gradle plugin latest version combination that worked for me.
try app module build.gradle
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "my package name"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
publishNonDefault true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
} }
dependencies {
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-vision:15.0.2'
implementation 'com.google.android.gms:play-services-analytics:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-iid:17.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-crash:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
And project level build.gradle like this
buildscript {
repositories {
maven { url 'https://maven.google.com' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.1.0'
}
}
I have a also same problem.Change old version of FirebaseAuth to newer version. for me I change "com.google.firebase:firebase-auth:11.4.0" to "com.google.firebase:firebase-auth:11.8.0"
As stated in the Google documentation, Add the latest version of the Google Service plugin (4.0.1 on 06/04/18). Hope this hepls!
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
}
}
`
Do not mix 12 and 15, use this
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
Same problem occurred with me. By updating library to latest one will resolve this problem.
After updating don't forget to do Sync project with gradle files.
Use:
compile 'com.google.firebase:firebase-auth:11.0.4'
This works.
You can easily solve this problem by getting the latest version of the Firebase Libraries for Android SDK.
You can get the latest library from https://firebase.google.com/docs/android/setup
Example:
Before:
implementation 'com.google.firebase:firebase-auth:10.6.0'
to
After:
implementation 'com.google.firebase:firebase-auth:16.0.4'
Just make sure all the implementations of firebase you are using have the same version inside the dependencies in build.gradle (app).
Just Simply Add this two dependency to your pubspec.yml. this works for me.
firebase_messaging: ^5.0.1
firebase_core: ^0.3.0
This error occurs only due to the difference in version. Whenever this kinda error occurs try to change the SDK versions, Gradle Build versions, or dependency version.
If you are using
targetSdkVersion = 26
compileSdkVersion = 26
'com.android.tools.build:gradle:3.6.3'
then add this version for firebase dependencies.
implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
It works.