com.google.android.gms:play-services-measurement-base is being requested by various other libraries
I updated to gradle 4.0.1 and started receiving following 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]], but resolves to 15.0.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
My project doesn't use that dependency so I searched globally for it, and it it only comes up inside
build/intermediates/lint-cache/maven.google/com/google/android/gms/group-index.xml
as this line
<play-services-measurement-base versions="15.0.0,15.0.2"/>
So I tried deleting my build folder and cleaning the project, but it regenerates it with same values :/ hence error still remains
The actual problem is discussed in the May, 23rd release note of https://developers.google.com/android/guides/releases#may_23_2018
Basically, you need to bump all Play Services and Firebase libraries to their latest version (which may be different for each since version 15). You may use https://mvnrepository.com/ to find the latest version for each library.
See also: https://firebase.google.com/support/release-notes/android#20180523
only working solution for me:
put it on the bottom of build.gradle
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Make Sure to keep Your Google play services dependencies and Firebase dependencies to latest version.
Also check all your gradle files, module level and project level, there has to be only one common version of dependency across all modules. Can be solved by keeping those versions in project level gradle variable.
Check here for Google play services update version
Google Play Services Latest
Check here for Firebase updated version
Firebase Latest
Check here for Firebase updated version for Android
Firebase Android Latest