3

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 ?

Ali Khoshraftar
  • 521
  • 1
  • 4
  • 16
  • 1
    Have you tried to change `classpath 'com.google.gms:google-services:4.0.1'` to `classpath 'com.google.gms:google-services:4.0.2'` and `classpath 'com.android.tools.build:gradle:3.2.0-alpha18'` to `classpath 'com.android.tools.build:gradle:3.1.4'`? Does it make any difference? – Alex Mamo Aug 15 '18 at 09:02
  • Try moving `firebase-core` to place it above the other firebase libs in the dependencies list. See this related question: https://stackoverflow.com/q/51025793/4815718 – Bob Snyder Aug 15 '18 at 13:37
  • please add all your dependencies. you have to remove this line: (implementation 'com.google.firebase:firebase-core:16.0.1'). it exists in other dependency. – Haniyeh Khaksar Aug 28 '18 at 05:02

2 Answers2

2

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.

mortezahosseini
  • 167
  • 1
  • 13
0

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

step:2

allprojects repositories

    google() // Google's Maven repository
Ashfaque
  • 179
  • 4