6

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

beigirad
  • 4,986
  • 2
  • 29
  • 52
S.P.
  • 2,274
  • 4
  • 26
  • 57
  • Can you post your gradle file both app and project – Anupam Jul 02 '19 at 08:22
  • 1
    Possible duplicate of [variantOutput.getPackageApplication() is obsolete](https://stackoverflow.com/questions/54206898/variantoutput-getpackageapplication-is-obsolete) – Martin Zeitler Jul 02 '19 at 11:40
  • by posting some stack-trace it is unclear which plugin may cause the warning (even if it seems to be `com.google.gms.googleservices`)... the issue can be reproduced with version `4.3.0`. – Martin Zeitler Jul 02 '19 at 11:49
  • I've fixed the problem with the Ashish solution in this link: https://stackoverflow.com/questions/56816296/firebase-dependencies-warning-api-variant-getmergeresources-is-obsolete-a/56816406 – S.P. Jul 16 '19 at 09:52
  • Possible duplicate of [API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'](https://stackoverflow.com/questions/56806004/api-variant-getmergeresources-is-obsolete-and-has-been-replaced-with-varian) – Roshana Pitigala Jul 30 '19 at 12:41

5 Answers5

6

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.

  • 1
    If you remove this line, all the libraries of google services still working ok? – S.P. Jul 09 '19 at 08:30
  • Its a small app and I only serve a few ads, so i have this line in dependencies `implementation 'com.google.android.gms:play-services-ads:18.0.0'` and that does it. From [here](https://developers.google.com/android/guides/setup). – Pancho Dyck Jul 09 '19 at 13:52
  • 1
    I try to remove this line apply plugin, then, google doesn't find the google_app_id – S.P. Jul 10 '19 at 10:54
5

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
user846316
  • 6,037
  • 6
  • 31
  • 40
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.

Emmanuel Ani
  • 121
  • 2
  • 10
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>
Ridha Rezzag
  • 3,672
  • 1
  • 34
  • 39
0

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.

beigirad
  • 4,986
  • 2
  • 29
  • 52