I'm getting multiple "Failed to Resolve" issues when syncing my project. They are all firebase and play-services related. I made sure they are all the same (11.2.0). I've also checked and the latest version for both is 11.2.0. Also, all the other answers to similar questions involve updating Google play services and repository in the SDK Manager but mine is already up to date.
Any idea why I can't sync my project?
EDIT - Current working solution
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.google.firebase:firebase-plugins:1.0.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Add maven { url "https://maven.google.com" } to your root level build.gradle file
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Play services and Firebase dependencies are now available via maven.google.com with the release of version 11.2.0 of Google Play services and Firebase.
You can find the Google Play Services official doc here and the firebase doc here..
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
If you are using the android gradle plugin 3.x you can also use:
allprojects {
repositories {
jcenter()
google()
}
}
I just fixed same error by adding firebase-core dependency.
implementation 'com.google.firebase:firebase-core:16.0.1'
With the 16.0.0 release of firebase I had to
set most my google play services libraries to 15.0.0 analytics and tagmanager needed to be 16.0.0
set my support library versions to 27.1.1
firebase-core to 16.0.0
Built against sdk 27
Extra Changes:
I also had to update my analytics to 16.0.0
implementation "com.google.android.gms:play-services-analytics:16.0.0"
Part of the independent versions thing Android did recently I am guessing. May need to try going up or down a version on the google play services and firebase libraries
The best Method to fix this problem is not using the manual method of linking firebase to your app.
I have tried adding latest firebase repo by referring to this
Link .
It showed error " failed to resolve the dependencies firebase 11.2.0"
FireBase recommends adding firebase to your app with the help of FireBase Assistant for Android Studio Version 2.2 and Higher. Manually adding the latest library to build-gradle(module) result in an error as above.
Firebase assistant added lower versions 10.0.1 automatically to dependencies on the module gradle-build which is compatible and could be resolved.
Using Firebase assistant is so easy and 2 step process. For reference, You can use the "Use the Firebase Assistant" section on the same link mentioned above.
It Really worked Out with my Android Studio 2.3.3. And also make sure Your Google Repository is up to date
From tools-> sdk manager-> sdk tools install google play service and google repository and sync your project will work fine
Related
Have a problem with connecting Firebase to the specific project. In Android Studio this project was successfully connected to Firebase Assistance. Cloud Messaging is working, but analytics isn't displaying.
Project settings:
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'io.fabric.tools:gradle:1.28.0'
classpath 'com.google.gms:google-services:4.2.0'
classpath "io.realm:realm-gradle-plugin:4.3.1"
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
}
}
Module settings:
dependencies {
...
implementation 'com.google.firebase:firebase-analytics:16.0.4'
...
}
apply plugin: 'com.google.gms.google-services'
To fix the problem have tried:
1)Different versions of google-services and firebase-analytics
2)Uninstall and install on different devices
3)Moving 'apply plugin' to the top of the file
4)Re-downloading google-services.json
After a long journey, I found certain Firebase connectivity nuances.
1)After successfully connecting Firebase if within the next half hour there are no events, an error about connecting the SDK will be shown until an event appears.
2)If you have previously connected Google maps, then you may have a file with the name "google_maps_api.xml", in which there may be a line with the key "google_app_id", which is why Analytics is not working and events do not reach. You need to comment on it.
Additional little issue.
When you connect analytics through the Firebase Assistant, you may need to comment on the plugin of the Fabric, otherwise, an error will occur.
And a few more tips.
If you have old dependencies of Google analytics, then it is better to remove them.
When you connect analytics through Firebase Assistant, do not forget to remove the old json, as well as comment on the dependencies of the Firebase and google plugin.
Also a solution to your problem could be increasing or decreasing the dependencies versions.
Do not delete your Fabric key even after you've migrated. For now, the Fabric key stays.
You can also try to reproduce your problem using this example.
I had the same problem, but after adding firebase analytics
implementation 'com.google.firebase:firebase-analytics-ktx:17.5.0'
And logged a simple analytic on my main activity onCreate, I got the notification of verified install.
val analytics = FirebaseAnalytics.getInstance(this)
with(Bundle()) {
putString("Splash", "test")
analytics.logEvent("Splash", this)
}
I am using Visual Studio Apache Cordova and in there I am having an admob service. I updated my google play services as well as google support services via sdk. Besides, I updated everything from my android sdk, but I am still seeing this error.
I do see something on google post that these services are no longer supported via sdk but need to be put as dependencies in the project itself. But I don't know how to proceed with that
Solution here:
Failed to resolve: com.google.android.gms:play-services-basement:12.0.1
In next future, I recommend to update gradle and SDK in your project.
For now you can to try to add maven in android/build.gradle:
buildscript {
repositories {
maven { url "https://maven.google.com" }
jcenter()
...
...
allprojects {
repositories {
mavenLocal()
maven { url "https://maven.google.com" }
jcenter()
...
...
I'm getting multiple "Failed to Resolve" issues when syncing my project. They are all firebase and play-services related. I made sure they are all the same (11.2.0). I've also checked and the latest version for both is 11.2.0. Also, all the other answers to similar questions involve updating Google play services and repository in the SDK Manager but mine is already up to date.
Any idea why I can't sync my project?
EDIT - Current working solution
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.google.firebase:firebase-plugins:1.0.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Add maven { url "https://maven.google.com" } to your root level build.gradle file
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Play services and Firebase dependencies are now available via maven.google.com with the release of version 11.2.0 of Google Play services and Firebase.
You can find the Google Play Services official doc here and the firebase doc here..
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
If you are using the android gradle plugin 3.x you can also use:
allprojects {
repositories {
jcenter()
google()
}
}
I just fixed same error by adding firebase-core dependency.
implementation 'com.google.firebase:firebase-core:16.0.1'
With the 16.0.0 release of firebase I had to
set most my google play services libraries to 15.0.0 analytics and tagmanager needed to be 16.0.0
set my support library versions to 27.1.1
firebase-core to 16.0.0
Built against sdk 27
Extra Changes:
I also had to update my analytics to 16.0.0
implementation "com.google.android.gms:play-services-analytics:16.0.0"
Part of the independent versions thing Android did recently I am guessing. May need to try going up or down a version on the google play services and firebase libraries
The best Method to fix this problem is not using the manual method of linking firebase to your app.
I have tried adding latest firebase repo by referring to this
Link .
It showed error " failed to resolve the dependencies firebase 11.2.0"
FireBase recommends adding firebase to your app with the help of FireBase Assistant for Android Studio Version 2.2 and Higher. Manually adding the latest library to build-gradle(module) result in an error as above.
Firebase assistant added lower versions 10.0.1 automatically to dependencies on the module gradle-build which is compatible and could be resolved.
Using Firebase assistant is so easy and 2 step process. For reference, You can use the "Use the Firebase Assistant" section on the same link mentioned above.
It Really worked Out with my Android Studio 2.3.3. And also make sure Your Google Repository is up to date
From tools-> sdk manager-> sdk tools install google play service and google repository and sync your project will work fine
I'm getting multiple "Failed to Resolve" issues when syncing my project. They are all firebase and play-services related. I made sure they are all the same (11.2.0). I've also checked and the latest version for both is 11.2.0. Also, all the other answers to similar questions involve updating Google play services and repository in the SDK Manager but mine is already up to date.
Any idea why I can't sync my project?
EDIT - Current working solution
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.google.firebase:firebase-plugins:1.0.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Add maven { url "https://maven.google.com" } to your root level build.gradle file
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Play services and Firebase dependencies are now available via maven.google.com with the release of version 11.2.0 of Google Play services and Firebase.
You can find the Google Play Services official doc here and the firebase doc here..
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
If you are using the android gradle plugin 3.x you can also use:
allprojects {
repositories {
jcenter()
google()
}
}
I just fixed same error by adding firebase-core dependency.
implementation 'com.google.firebase:firebase-core:16.0.1'
With the 16.0.0 release of firebase I had to
set most my google play services libraries to 15.0.0 analytics and tagmanager needed to be 16.0.0
set my support library versions to 27.1.1
firebase-core to 16.0.0
Built against sdk 27
Extra Changes:
I also had to update my analytics to 16.0.0
implementation "com.google.android.gms:play-services-analytics:16.0.0"
Part of the independent versions thing Android did recently I am guessing. May need to try going up or down a version on the google play services and firebase libraries
The best Method to fix this problem is not using the manual method of linking firebase to your app.
I have tried adding latest firebase repo by referring to this
Link .
It showed error " failed to resolve the dependencies firebase 11.2.0"
FireBase recommends adding firebase to your app with the help of FireBase Assistant for Android Studio Version 2.2 and Higher. Manually adding the latest library to build-gradle(module) result in an error as above.
Firebase assistant added lower versions 10.0.1 automatically to dependencies on the module gradle-build which is compatible and could be resolved.
Using Firebase assistant is so easy and 2 step process. For reference, You can use the "Use the Firebase Assistant" section on the same link mentioned above.
It Really worked Out with my Android Studio 2.3.3. And also make sure Your Google Repository is up to date
From tools-> sdk manager-> sdk tools install google play service and google repository and sync your project will work fine
I was trying to install new firebase database into my app, but it was failed with next error:
Error:Could not find com.google.firebase:firebase-database:9.2.0. Required
by:
appName:app:unspecified
than i clone official google example frome here and was trying to build database example, but i still get same error...
looks like this is because of some google error. am i right?
in other case, why it happens and how to fix this?
You have to update/install Google Repository, revision 30 (Your android studio latest version).
Instead of adding the project, Just add google services dependency to you root level gradle classpath 'com.google.gms:google-services:3.0.0'
and firebase database dependency to your app level gradle compile 'com.google.firebase:firebase-database:9.2.0'
The part I was missing was in by build.gradle (Project:). Make sure this is there:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
It allows the project to find it in Google's Maven repository.