I have a problem on my Android project, I can't build, this is the error I have:
Failed to notify dependency resolution listener.
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.
I tried many different solution I found but the problem persists.
I have the right dependencies and repositories on gradle file on project root:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'
}
and
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven {
url "https://maven.google.com"
}
}
On my app gradle I have the following dependencies:
implementation "com.google.android.gms:play-services-maps:15.0.1"
implementation "com.google.android.gms:play-services-places:15.0.1"
implementation "com.google.android.gms:play-services-gcm:15.0.1"
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.android.gms:play-services-analytics:15.0.2"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-tagmanager:15.0.2"
implementation "com.google.firebase:firebase-core:16.0.0"
Some suggestions?
The solution was update the following dependencies:
implementation "com.google.android.gms:play-services-analytics:16.0.0"
implementation "com.google.android.gms:play-services-tagmanager:16.0.0"
I just added right after the apply plugin: 'com.google.gms.google-services' at the bottom of my build.gradle :
apply plugin: 'com.google.gms.google-services'
// Work around
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
I had the same exact error, upgrading analytics was the key:
implementation 'com.google.android.gms:play-services-analytics:16.0.0'
I know you thought everything is updated referring to the official website, but writing 15.0.0 and looking for suggestions works better.
Update project gradle play service dependency with latest release :
classpath 'com.google.gms:google-services:4.0.1' and
Update project firebase products usage as per firebase latest release note
this shoud be on top if you use firebase libraries:
implementation "com.google.firebase:firebase-core:16.0.0"
This worked for me.this shoud be on top if you use firebase libraries:
implementation "com.google.firebase:firebase-core:15.0.0"
In my case the issue was OneSignal, which somehow broke everything down.
They even have a dedicated library for this: https://github.com/OneSignal/OneSignal-Gradle-Plugin
and the actual issue was that OneSignal was inside my app-level gradle, instead of root one.
Freaking ridiculous!
Check Answer by Bhupendra Acharya from
https://groups.google.com/forum/#!topic/firebase-talk/XbGR-YrsTTA works for you. I got the following error
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
While using
implementation 'com.google.firebase:firebase-core:16.0.1'
And resolved by updating the version
implementation 'com.google.firebase:firebase-core:16.0.4'
My problem was that I was importing oneSignal gradle plugin but I do not import the full apply plugin: 'com.google.gms.google-services'.
To fix I just had to add the implementations I was using.
For future users: Open build.gradle files and just hover your mouse on the dependencies and a tooltip gonna show up telling your the newest version and that should solve your problem.
Beware that Firebase Documentations does not have the newest versions.
update classpath for com.google.firebase:firebase-core:16+
classpath 'com.google.gms:google-services:4.2.0'
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
Try this one , place maven url on top inside repositories in build.gradle
Update build.gradle
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2' //< update version
classpath 'com.google.gms:google-services:3.1.1' //< update version
}
}
This would help you I guess
Update the build.gradle file from the project root folder. I've tried this and it was helping.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
----
}}
Make sure you added following line in bottom of app gradle
apply plugin: 'com.google.gms.google-services'
Make sure you are using compatible google-services in project level gradle
dependencies {
classpath 'com.google.gms:google-services:4.0.1'
}
Check if you have added following dependency
implementation 'com.google.firebase:firebase-core:16.0.1'
I have answered a similar issue here. You need to keep versions of play services and firebase to latest one. Check here for links
https://stackoverflow.com/a/52696667/3333878
Try to set
classpath 'com.google.gms:google-services:3.2.1'
instead of
classpath 'com.google.gms:google-services:4.0.1'
It's helped in my case, but I don't know the cause of the error.
Related
I followed the tutorial exactly (https://firebase.google.com/docs/crashlytics/get-started?authuser=1&platform=android#android) and still can't see my app on firebase Crashlytics. here's my configuration:
in root build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath 'io.fabric.tools:gradle:1.31.0'
}
in app build.gradle
...
apply plugin: "io.fabric"
...
//Firebase
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-config:18.0.0'
implementation 'com.google.firebase:firebase-analytics:17.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
in Application
Fabric.with(this, Crashlytics());
I'm building and running the app on debug but nothing is happening, in the logs I see
I/CrashlyticsInitProvider: CrashlyticsInitProvider skipping initialization
I/CrashlyticsCore: Initializing Crashlytics Core 2.7.0.33
what could I be missing?
For anyone who is facing a similar issue, I have looked for many hours and eventually checked the merged manifest and figured there is a 3rd party library that was actually setting up their own Crashlytics config which overrides mine. So maybe look into that.
I eventually added this to my manifest:
<meta-data
tools:node="remove"
android:name="io.fabric.ApiKey"/>
Refer to the Firebase Crashlytics Docs.
Step 1: Add this code in your project level build.gradle file
buildscript {
repositories {
// Add the following repositories:
google() // Google's Maven repository
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
// ...
// Check for v3.1.2 or higher
classpath 'com.google.gms:google-services:4.3.0' // Google Services plugin
// Add dependency
classpath 'io.fabric.tools:gradle:1.31.0' // Crashlytics plugin
}
}
allprojects {
// ...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
// ...
}
}
Step 2 : Add this code in your app-level build.gradle file
apply plugin: 'io.fabric'
dependencies {
// ...
// Check for v11.4.2 or higher
implementation 'com.google.firebase:firebase-core:17.0.1'
// (Recommended) Add Analytics
implementation 'com.google.firebase:firebase-analytics:17.0.1'
// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}
Make sure you have added google-services.json and running your app in physical device or emulator having google play services.
credit goes to firebase for creating such a helpful docs.
This is Zubair from Fabric/Firebase. Could you try to make individual build and run event on a brand new simulator (where they've not installed/ran this app before). If issue persist, reach out to us AT "support#fabric.io" and include app name/bundle id and firebase project id in the email.
I am getting the following error:
Cannot change dependencies of configuration ':app:api' after it has been included in dependency resolution.
Updated:
I am able to build using com.google.gms:google-services:3.3.0 when data binding is disabled, but this is not a solution for someone that requires data binding to be enabled.
After Google announced the new sdk versioning system (link), I did the following steps:
I updated the gradle files as directed to include the gms and firebase version numbers separately. Updated the apply plugin line, updated the classpath. I am still getting the error and dont know the reason.
Below are relevant gradle files:
build.gradle (main):
buildscript {
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/rvalerio/maven' }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'io.realm:realm-gradle-plugin:4.3.3'
classpath 'io.fabric.tools:gradle:1.25.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
}
}
build.gradle (Module:app)
apply plugin: 'com.google.gms.google-services'
Firebase dependencies:
//Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-config:15.0.2"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true
}
GMS and other dependencies
implementation "com.android.support:recyclerview-v7:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
implementation "com.android.support:cardview-v7:27.1.1"
implementation "com.android.support:design:27.1.1"
implementation "com.android.support:support-v13:27.1.1"
implementation "com.android.support.constraint:constraint-layout:1.1.0"
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.android.gms:play-services-vision:15.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-maps:15.0.1"
I have pasted the error log on pastebin from android studio 3.1.2 here.
Any help is appreciated!
managed to build against Play Services & Firebase 15.0.0 with data-binding enabled ...my dependencies now look about alike this and it builds again, without any Cannot change dependencies of configuration complaints:
buildscript {
dependencies {
classpath "com.android.tools.build:gradle:3.1.2"
// do not update, because 3.3.1 appears broken
// classpath "com.google.gms:google-services:3.2.1"
// meanwhile, there is version 4.0.2 available
classpath "com.google.gms:google-services:4.0.2"
}
}
one has to reference all the libraries individually. just referencing com.google.android.gms:play‐services and/or com.google.firebase:firebase-core does not work anymore since 15.0.0.
android {
dependencies {
// Play Services 15.0.0
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-identity:15.0.1"
// Firebase 15.0.0
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-database:15.0.1"
implementation "com.google.firebase:firebase-firestore:16.0.0"
implementation "com.google.firebase:firebase-storage:15.0.2"
implementation "com.google.firebase:firebase-crash:15.0.2"
implementation "com.google.firebase:firebase-auth:15.1.0"
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-config:15.0.2"
implementation "com.google.firebase:firebase-invites:15.0.1"
implementation "com.google.firebase:firebase-ads:15.0.1"
implementation "com.google.firebase:firebase-appindexing:15.0.1"
implementation "com.google.firebase:firebase-perf:15.2.0"
implementation "com.google.firebase:firebase-functions:15.0.0"
}
}
apply plugin: 'com.google.gms.google-services'
also had to edit the Manifest.xml to fix the support library:
<application>
<meta-data
android:name="android.support.VERSION"
android:value="27.1.1"
tools:replace="android:value"/>
</application
The issue with data binding and the 3.3.0 version of the google-services plugin has been reported here: https://issuetracker.google.com/issues/79122163
As of today, the bug is in the "assigned" state.
UPDATE
I could compile also with
dataBinding.enabled false
In android configuration and version 3.3.0
ORIGINAL
Same problem here with google-services:3.3.0, which is the last version, but according to docs version 3.2.1 should be used. I've been able to compile with the following
ext {
kotlin_version = '1.2.41'
firebaseCore = '15.0.2'
authentication = '15.1.0'
cloudFirestore = '16.0.0'
cloudStorage = '15.0.2'
crashlitics = '2.9.1'
googleServices = '15.0.0'
supportLibrary = '27.1.1'
facebookSdkVersion = '4.31.0'
twitterSdkVersion = '3.1.1'
firebaseUI = '3.3.1'
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha12'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.2.1'
}
This issue seems to have been resolved by using the new google-services release (4.0.1 as of today). Below is the relevant versions that will resolve the stated issue:
In your project build.gradle files:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1' }
In your app build.gradle files:
//Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:17.0.0"
implementation "com.google.firebase:firebase-core:16.0.0"
implementation "com.google.firebase:firebase-config:16.0.0"
implementation 'com.google.firebase:firebase-perf:16.0.0'
...} apply plugin: "com.google.gms.google-services"
Databinding is set to true as well:
dataBinding {
enabled = true
}
Android Studio version: 3.1.2
Thank you all for providing various ways you can get around the problem, such as the answer by #Kyle and the medium post link that shows you how to use firebase without google services.
Just downgrade your GooglePlay services dependency to 3.2.1 :)
classpath 'com.google.gms:google-services:3.2.1'
While not a great solution, I followed the recommendation from a Googler mentioned on the bug tracker.
I am using
com.google.gms:google-services:3.3.1
I have enabled databinding
`dataBinding.enabled true`
I removed the plugin reference from the app gradle script
//apply plugin: 'com.google.gms.google-services'
And followed the recommendations from this Medium post to include all of the necessary Google Service string values.
https://medium.com/#samstern_58566/how-to-use-firebase-on-android-without-the-google-services-plugin-93ecc7dc6c4
My app builds successfully and everything works as expected.
Everything worked after I added the google() maven inside the allProjects block in my project build.gradle like this:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
...
}
}
repositories {
...
}
// You need to add the google maven in this block.
allprojects {
repositories {
jcenter()
google()
}
}
I am getting the following error:
Cannot change dependencies of configuration ':app:api' after it has been included in dependency resolution.
Updated:
I am able to build using com.google.gms:google-services:3.3.0 when data binding is disabled, but this is not a solution for someone that requires data binding to be enabled.
After Google announced the new sdk versioning system (link), I did the following steps:
I updated the gradle files as directed to include the gms and firebase version numbers separately. Updated the apply plugin line, updated the classpath. I am still getting the error and dont know the reason.
Below are relevant gradle files:
build.gradle (main):
buildscript {
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/rvalerio/maven' }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'io.realm:realm-gradle-plugin:4.3.3'
classpath 'io.fabric.tools:gradle:1.25.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
}
}
build.gradle (Module:app)
apply plugin: 'com.google.gms.google-services'
Firebase dependencies:
//Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-config:15.0.2"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true
}
GMS and other dependencies
implementation "com.android.support:recyclerview-v7:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
implementation "com.android.support:cardview-v7:27.1.1"
implementation "com.android.support:design:27.1.1"
implementation "com.android.support:support-v13:27.1.1"
implementation "com.android.support.constraint:constraint-layout:1.1.0"
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.android.gms:play-services-vision:15.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-maps:15.0.1"
I have pasted the error log on pastebin from android studio 3.1.2 here.
Any help is appreciated!
managed to build against Play Services & Firebase 15.0.0 with data-binding enabled ...my dependencies now look about alike this and it builds again, without any Cannot change dependencies of configuration complaints:
buildscript {
dependencies {
classpath "com.android.tools.build:gradle:3.1.2"
// do not update, because 3.3.1 appears broken
// classpath "com.google.gms:google-services:3.2.1"
// meanwhile, there is version 4.0.2 available
classpath "com.google.gms:google-services:4.0.2"
}
}
one has to reference all the libraries individually. just referencing com.google.android.gms:play‐services and/or com.google.firebase:firebase-core does not work anymore since 15.0.0.
android {
dependencies {
// Play Services 15.0.0
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-identity:15.0.1"
// Firebase 15.0.0
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-database:15.0.1"
implementation "com.google.firebase:firebase-firestore:16.0.0"
implementation "com.google.firebase:firebase-storage:15.0.2"
implementation "com.google.firebase:firebase-crash:15.0.2"
implementation "com.google.firebase:firebase-auth:15.1.0"
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-config:15.0.2"
implementation "com.google.firebase:firebase-invites:15.0.1"
implementation "com.google.firebase:firebase-ads:15.0.1"
implementation "com.google.firebase:firebase-appindexing:15.0.1"
implementation "com.google.firebase:firebase-perf:15.2.0"
implementation "com.google.firebase:firebase-functions:15.0.0"
}
}
apply plugin: 'com.google.gms.google-services'
also had to edit the Manifest.xml to fix the support library:
<application>
<meta-data
android:name="android.support.VERSION"
android:value="27.1.1"
tools:replace="android:value"/>
</application
The issue with data binding and the 3.3.0 version of the google-services plugin has been reported here: https://issuetracker.google.com/issues/79122163
As of today, the bug is in the "assigned" state.
UPDATE
I could compile also with
dataBinding.enabled false
In android configuration and version 3.3.0
ORIGINAL
Same problem here with google-services:3.3.0, which is the last version, but according to docs version 3.2.1 should be used. I've been able to compile with the following
ext {
kotlin_version = '1.2.41'
firebaseCore = '15.0.2'
authentication = '15.1.0'
cloudFirestore = '16.0.0'
cloudStorage = '15.0.2'
crashlitics = '2.9.1'
googleServices = '15.0.0'
supportLibrary = '27.1.1'
facebookSdkVersion = '4.31.0'
twitterSdkVersion = '3.1.1'
firebaseUI = '3.3.1'
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha12'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.2.1'
}
This issue seems to have been resolved by using the new google-services release (4.0.1 as of today). Below is the relevant versions that will resolve the stated issue:
In your project build.gradle files:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1' }
In your app build.gradle files:
//Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:17.0.0"
implementation "com.google.firebase:firebase-core:16.0.0"
implementation "com.google.firebase:firebase-config:16.0.0"
implementation 'com.google.firebase:firebase-perf:16.0.0'
...} apply plugin: "com.google.gms.google-services"
Databinding is set to true as well:
dataBinding {
enabled = true
}
Android Studio version: 3.1.2
Thank you all for providing various ways you can get around the problem, such as the answer by #Kyle and the medium post link that shows you how to use firebase without google services.
Just downgrade your GooglePlay services dependency to 3.2.1 :)
classpath 'com.google.gms:google-services:3.2.1'
While not a great solution, I followed the recommendation from a Googler mentioned on the bug tracker.
I am using
com.google.gms:google-services:3.3.1
I have enabled databinding
`dataBinding.enabled true`
I removed the plugin reference from the app gradle script
//apply plugin: 'com.google.gms.google-services'
And followed the recommendations from this Medium post to include all of the necessary Google Service string values.
https://medium.com/#samstern_58566/how-to-use-firebase-on-android-without-the-google-services-plugin-93ecc7dc6c4
My app builds successfully and everything works as expected.
Everything worked after I added the google() maven inside the allProjects block in my project build.gradle like this:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
...
}
}
repositories {
...
}
// You need to add the google maven in this block.
allprojects {
repositories {
jcenter()
google()
}
}
I am getting the following error:
Cannot change dependencies of configuration ':app:api' after it has been included in dependency resolution.
Updated:
I am able to build using com.google.gms:google-services:3.3.0 when data binding is disabled, but this is not a solution for someone that requires data binding to be enabled.
After Google announced the new sdk versioning system (link), I did the following steps:
I updated the gradle files as directed to include the gms and firebase version numbers separately. Updated the apply plugin line, updated the classpath. I am still getting the error and dont know the reason.
Below are relevant gradle files:
build.gradle (main):
buildscript {
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/rvalerio/maven' }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'io.realm:realm-gradle-plugin:4.3.3'
classpath 'io.fabric.tools:gradle:1.25.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
}
}
build.gradle (Module:app)
apply plugin: 'com.google.gms.google-services'
Firebase dependencies:
//Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-config:15.0.2"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true
}
GMS and other dependencies
implementation "com.android.support:recyclerview-v7:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
implementation "com.android.support:cardview-v7:27.1.1"
implementation "com.android.support:design:27.1.1"
implementation "com.android.support:support-v13:27.1.1"
implementation "com.android.support.constraint:constraint-layout:1.1.0"
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.android.gms:play-services-vision:15.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-maps:15.0.1"
I have pasted the error log on pastebin from android studio 3.1.2 here.
Any help is appreciated!
managed to build against Play Services & Firebase 15.0.0 with data-binding enabled ...my dependencies now look about alike this and it builds again, without any Cannot change dependencies of configuration complaints:
buildscript {
dependencies {
classpath "com.android.tools.build:gradle:3.1.2"
// do not update, because 3.3.1 appears broken
// classpath "com.google.gms:google-services:3.2.1"
// meanwhile, there is version 4.0.2 available
classpath "com.google.gms:google-services:4.0.2"
}
}
one has to reference all the libraries individually. just referencing com.google.android.gms:play‐services and/or com.google.firebase:firebase-core does not work anymore since 15.0.0.
android {
dependencies {
// Play Services 15.0.0
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-identity:15.0.1"
// Firebase 15.0.0
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-database:15.0.1"
implementation "com.google.firebase:firebase-firestore:16.0.0"
implementation "com.google.firebase:firebase-storage:15.0.2"
implementation "com.google.firebase:firebase-crash:15.0.2"
implementation "com.google.firebase:firebase-auth:15.1.0"
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-config:15.0.2"
implementation "com.google.firebase:firebase-invites:15.0.1"
implementation "com.google.firebase:firebase-ads:15.0.1"
implementation "com.google.firebase:firebase-appindexing:15.0.1"
implementation "com.google.firebase:firebase-perf:15.2.0"
implementation "com.google.firebase:firebase-functions:15.0.0"
}
}
apply plugin: 'com.google.gms.google-services'
also had to edit the Manifest.xml to fix the support library:
<application>
<meta-data
android:name="android.support.VERSION"
android:value="27.1.1"
tools:replace="android:value"/>
</application
The issue with data binding and the 3.3.0 version of the google-services plugin has been reported here: https://issuetracker.google.com/issues/79122163
As of today, the bug is in the "assigned" state.
UPDATE
I could compile also with
dataBinding.enabled false
In android configuration and version 3.3.0
ORIGINAL
Same problem here with google-services:3.3.0, which is the last version, but according to docs version 3.2.1 should be used. I've been able to compile with the following
ext {
kotlin_version = '1.2.41'
firebaseCore = '15.0.2'
authentication = '15.1.0'
cloudFirestore = '16.0.0'
cloudStorage = '15.0.2'
crashlitics = '2.9.1'
googleServices = '15.0.0'
supportLibrary = '27.1.1'
facebookSdkVersion = '4.31.0'
twitterSdkVersion = '3.1.1'
firebaseUI = '3.3.1'
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha12'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.2.1'
}
This issue seems to have been resolved by using the new google-services release (4.0.1 as of today). Below is the relevant versions that will resolve the stated issue:
In your project build.gradle files:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1' }
In your app build.gradle files:
//Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:17.0.0"
implementation "com.google.firebase:firebase-core:16.0.0"
implementation "com.google.firebase:firebase-config:16.0.0"
implementation 'com.google.firebase:firebase-perf:16.0.0'
...} apply plugin: "com.google.gms.google-services"
Databinding is set to true as well:
dataBinding {
enabled = true
}
Android Studio version: 3.1.2
Thank you all for providing various ways you can get around the problem, such as the answer by #Kyle and the medium post link that shows you how to use firebase without google services.
Just downgrade your GooglePlay services dependency to 3.2.1 :)
classpath 'com.google.gms:google-services:3.2.1'
While not a great solution, I followed the recommendation from a Googler mentioned on the bug tracker.
I am using
com.google.gms:google-services:3.3.1
I have enabled databinding
`dataBinding.enabled true`
I removed the plugin reference from the app gradle script
//apply plugin: 'com.google.gms.google-services'
And followed the recommendations from this Medium post to include all of the necessary Google Service string values.
https://medium.com/#samstern_58566/how-to-use-firebase-on-android-without-the-google-services-plugin-93ecc7dc6c4
My app builds successfully and everything works as expected.
Everything worked after I added the google() maven inside the allProjects block in my project build.gradle like this:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
...
}
}
repositories {
...
}
// You need to add the google maven in this block.
allprojects {
repositories {
jcenter()
google()
}
}
Can't use google maps because of above said error. Anyone find the same issue ?
Make sure that the following line is at the end of the app build.gradle file:
apply plugin: 'com.google.gms.google-services'
Mine was on the top and gradle was defaulting to 8.3.0 instead of what was specified: 8.4.0
My build.gradle files are the same as the ones in the Version conflict updating to 8.4.0
As those previous anweres are only part-wise complete.
Here are my three steps which worked fine for me:
Put this to the end of your apps build.gradle
apply plugin: 'com.google.gms.google-services'
Set your projects build.gradle dependencies to
'classpath 'com.google.gms:google-services:2.0.0-alpha5'
Set Gradle Version to 2.10
Android Studio: File > Project Structure > Project
#redsonic's answer worked for me.. By simply moving apply plugin:
'com.google.gms.google-services' after the dependecies in
build.gradle (Module: app)
I'm using Android Studio 1.5.1 with Gradle version 2.10
In case you are using Gradle version older than 2.10 you'll also need to update that by selecting the ProjectName or app directory in the Project tool Windows and pressing F4. This will open Project Structure window, select Project from the menu and update Gradle version to 2.10. Press OK (Android Studio will download it in background).
build.gradle (Project: ProjectName)
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:2.0.0-alpha6'
}
build.gradle (Module: app)
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:8.4.0'
}
apply plugin: 'com.google.gms.google-services'
This is a slight variant of #Lord Flash's answer:
For me it wasn't necessarily that I should place the google services plugin at the bottom of the file it was that it should come before the com.android.application plugin.
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
Also there are newer binaries than the alpha variants for google-services
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:2.0.0-beta6'
}
}
I'm sure there will be newer ones soon. I found the list of variants here
follow all the steps at this link Add App Invites to Your App
use this : compile 'com.google.android.gms:play-services-appinvite:8.4.0'
instead of this : compile 'com.google.android.gms:play-services:8.4.0'
please follow all the steps and then build the project
hope thats help
I had the same problem, and I found that moving:
apply plugin: 'com.google.gms.google-services'
To the bottom of the module app gradle.
and then use:
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:2.1.0'
The problem is that some of your app dependencies that start with com.google.android.gms: have a version that is incompatible your project dependencie classpath 'com.google.gms:google-services:
Check for these on your app build.gradle
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
And for this in your project build.gradle
classpath 'com.google.gms:google-services:1.5.0'
You can update your project build.gradle to use the latest google-services version or your can just change your app dependencies to use the 8.3 version.
// 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.1.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// this should solve the gradle update error if it persists even after following above steps
Make sure that the following line is at the end of the app build.gradle file:
compile 'com.google.android.gms:play-services:11.0.2'
google update there API day by day.Now mine is '11.0.2'
try with the updated API