WARNING: API 'variant.getMergeResources()'

2020-03-20 06:34发布

I've been getting this error 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

4条回答
手持菜刀,她持情操
2楼-- · 2020-03-20 07:03

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.

查看更多
家丑人穷心不美
3楼-- · 2020-03-20 07:04

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
查看更多
爷、活的狠高调
4楼-- · 2020-03-20 07:07

Use this in your project gradle -

buildscript {

    dependencies {

         classpath 'com.android.tools.build:gradle:3.1.4'
    }
 }
查看更多
甜甜的少女心
5楼-- · 2020-03-20 07:18

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.

查看更多
登录 后发表回答