Failed to resolve: com.google.firebase:firebase-firestore:16.0.1
To solve this, please change the following lines of code:
implementation 'com.google.firebase:firebase-core:16.0.1'
//dependency for using firebase database
implementation 'com.google.firebase:firebase-database:16.0.1'
//dependency for email and password authentication
implementation 'com.google.firebase:firebase-auth:16.0.1'
//dependency for cloud storage
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-firestore:16.0.1'
to
implementation 'com.google.firebase:firebase-core:16.0.6'
//dependency for using firebase database
implementation 'com.google.firebase:firebase-database:16.0.6'
//dependency for email and password authentication
implementation 'com.google.firebase:firebase-auth:16.1.0'
//dependency for cloud storage
implementation 'com.google.firebase:firebase-storage:16.0.5'
//implementation 'com.google.firebase:firebase-auth:16.0.1' //Removed
implementation 'com.google.firebase:firebase-firestore:18.0.0
Please don't also forget to add the as the last line in your file:
apply plugin: 'com.google.gms.google-services'
Failed to resolve: com.google.firebase:firebase-messaging:16.0.5
firebase-messaging 16.0.x version seems unavailable, That why we
getting the error"Failed to resolve: com.google.firebase:firebase-messaging:16.0.5"
In order to fix it keep the other 16.0.x versions as it is
and upgrade 17.x.x versions to the latest
code is given below
def Firebase_Auth_Version = "16.0.5"
def Firebase_Messaging_Version = "17.3.4"
implementation "com.google.firebase:firebase-messaging:$Firebase_Messaging_Version"
implementation "com.google.firebase:firebase-auth:$Firebase_Auth_Version"
Failed to resolve: com.google.firebase:firebase-core:16.0.1
From the docs:-
Your app gradle file now has to explicitly list
com.google.firebase:firebase-core
as a dependency for Firebase services to work as expected.
Add:
implementation 'com.google.firebase:firebase-core:16.0.1'
and in top level gradle file use the latest version of google play services:
classpath 'com.google.gms:google-services:4.0.2'
https://firebase.google.com/support/release-notes/android
https://bintray.com/android/android-tools/com.google.gms.google-services
Note:
You need to add the google()
repo in the top level gradle file, as specified in the firebase docs and also it should be before jcenter()
:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
https://firebase.google.com/docs/android/setup
Failed to resolve: com.google.firebase:firebase-core:16.0.5
From https://firebase.google.com/docs/android/setup it looks like 16.0.4 is latest version
com.google.firebase:firebase-core:16.0.4
Why I am getting this Could not find com.google.firebase:firebase-core:16.1.0. error all the time?
Could not find com.google.firebase:firebase-core:16.1.0"
It happens because firebase-core:16.1.0 doesn't exist (today).
You can check the latest version here. Currently it is 16.0.7
Firebase Core com.google.firebase:firebase-core:16.0.7
Change your dependency in:
implementation 'com.google.firebase:firebase-core:16.0.7'
failed to resolve: com.google.firebase:firebase-core:16.0.0
I notice you need to updates a lot of your scripts.
For example, let's start with your top-level build.gradle
. You should no longer use android gradle plugin 2.+, instead you should use version 3.1.x
And to do that, you should put google()
in your repositories.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
//Add this line
google()
}
dependencies {
//Please update it to 3.1.x
classpath 'com.android.tools.build:gradle:3.1.2'
//Update to the latest version as well
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Some tips:
Try to update your app-level build.gradle
, from compile
to implementation
since they will be deprecated soon.
Failed to resolve com.google.firebase:firebase-database:16.0.1
Try adding google() repo in top level gradle file :
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.0.1' // google-services
plugin
}
}
allprojects {
// ...
repositories {
// ...
google() // Google's Maven repository
}
}
Related Topics
Singleton Class with Several Different Classloaders
Find First Element by Predicate
Javafx - Border Radius <-> Background Color
Registering a Headset Button Click with Broadcastreceiver in Android
Show Only Two Digit After Decimal
Which Jdk Version (Language Level) Is Required for Android Studio
What Exactly Is a Context in Java
Getting JSONobject from JSONarray
How to Make a Jtable Non-Editable
Displaying a Histogram of Image Data
Difference Between Java.Util.Random and Java.Security.Securerandom
How to Use Jsp/Jstl to Generate Dynamic CSS/JavaScript Files
How to Programmatically Enable Gps in Android Cupcake
How to Use Okhttp to Upload a File
How to Check Wifi or 3G Network Is Available on Android Device