3

I have updated my google-services plugin to 4.3.0

And when I sync my project I get the following warning.

 WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
 It will be removed at the end of 2019.
 For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
 To determine what is calling variant.getMergeResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
 Affected Modules: app

How to fix this warning?

Denis Zavedeev
  • 7,627
  • 4
  • 32
  • 53
Rafat Hossain
  • 99
  • 1
  • 4

1 Answers1

1

This warning is being produced by some library or plugin that you've used as a dependency which didn't update to the newer API as the warning states. If you want to detect, include the following in your project's gradle.properties file:

android.debug.obsoleteApi=true

As this official link to the gradle features states, it will help you to determine where that obsolete API is being used. Disable the plugin(s) you find in the log and the error should be gone.

However, please create an issue for that library on its Github repository, which is why if you google this warning you'll see plenty of GitHub libraries with open issues with such warning (Google AR Sceneform Android SDK, Flutter, GreenDAO and many more). Then it's up to them to fix it. Hope it helps!

A special note: if you're using fabric/crashlytics you're most likely to see this warning. Make sure you're using the updated ones as this fix on a closed issue suggests, update the classpath & gradle should remove the warning:

buildscript {
    //..
    dependencies {
        //..
        classpath 'io.fabric.tools:gradle:1.28.0'
    }
}
SaadAAkash
  • 3,065
  • 3
  • 19
  • 25