Ali Khoshraftar
Ali Khoshraftar

Reputation: 542

Gradle sync failure after Firebase update

From yesterday ( 2018/08/14 ) i can't build our project without any change ( 2 days ago it was works fine ) because of this error :

Failed to resolve: play-services-auth-base

So i searched for this and some solutions found that said update firebase dependencies and something like this. We updated all of google dependencies but still get error. here is my gradle google dependencies :

//moudule level gradle

implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.firebase:firebase-config:15.0.2'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.android.gms:play-services-auth:15.0.1'

//project level build.gradle

classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
classpath 'com.google.gms:google-services:4.0.1'

After update to this :

implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-config:16.0.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.android.gms:play-services-auth:16.0.0'

I got this error :

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.4,15.0.4], [16.0.0,16.0.0]], but resolves to 16.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Google Updated Firebase : Firebase Android Release Notes

What is the problem ?

Upvotes: 3

Views: 1793

Answers (2)

mortezahosseini
mortezahosseini

Reputation: 177

In my case there is conflict with firebase versions and oneSignal library: set version of oneSignal from 0.8.1 to 0.11.2 fix my problem.

These are firebase dependencies:

implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-config:16.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.0'

Thats it!

Below Solution works fine too!

Set version of dependencies to 11.8.0 like this:

implementation 'com.google.firebase:firebase-config:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'

Then remove/comment this line:

implementation 'com.google.firebase:firebase-auth ...

I found that there is conflict in these dependencies because of : Transitive Dependencies.

Upvotes: 2

Ashfaque
Ashfaque

Reputation: 332

step:1 classpath 'com.google.gms:google-services:4.1.0' // google-services plugin

step:2

allprojects repositories

    google() // Google's Maven repository

Upvotes: 0

Related Questions