WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'

Viewed 5393

I've been getting this warning every time I build my app. I think that I have all the libraries updates, someone can tell me where is the problem? Apparently, I think that could be from Google Play services, but I have the last version of all the libraries that I'm using.

I can't find anything that can fix the problem

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

5 Answers

I had exactly same warning and i removed this line from my app's build.gradle.

apply plugin: 'com.google.gms.google-services'

Turned out i didn't need the plugin and the warning disappeared.

Looks like it is caused by gms services 4.3.0. This seems to be just a warning and not causing any problems. However, if you want you can use an earlier version of gms services in your project level gradle file to get rid of it:

com.google.gms:google-services:4.2.0

Technically it's a 'WARNING' and not an error. To eliminate the need for the warning, downgrade your gms to a lower version such as 4.2.0.

for thoe who are still facing the same problem in my case the error was becasue of the french apostroph ( ' )

i had this string translated to french, it was causing the error

<string name="same_address">l'adresse de départ et l'adresse d'arrivée sont les mêmes!</string>

you have to add a back slash () befor any apostroph like this:

<string name="same_address">l\'adresse de départ et l\'adresse d\'arrivée sont les mêmes!</string>

According to official firebase documents, this issue has in version 4.3.2 of google-services plugin.

google-services plugin 4.3.2

Fixed the getMergeResourcesProvider warning. For more details, refer to GitHub PR 82.

So upgrade com.google.gms:google-services classpath to 4.3.2 or higher.

Related