0

I use Android Studio 3.5.0 and Gradle version 5.6.1, 5.6, 5.4.1, but still get the same results:

INFO: 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.

all of my gradle file included in here

https://gist.github.com/derohimat/b7832dc4973a125c289c804998519518

Deni Rohimat
  • 162
  • 7

2 Answers2

0

In my case, it was caused from gms services 4.3.1. So i had to change it to:

com.google.gms:google-services:4.2.0

I have found this by running:

gradlew sync -Pandroid.debug.obsoleteApi=true

in terminal. Go to view -> tool windows -> Terminal in Android Studio.

Hope your problem will solve

Cyrille Con Morales
  • 918
  • 1
  • 6
  • 21
0

INFO: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'. It will be removed at the end of 2019.

First of all, this is only a normal information that tells you about the API deprecation, which is a usual deprecation process over several Gradle major releases. So, no much worry about it.

Secondly, as of Gradle 5.1, it is recommended that the configuration avoidance APIs be used whenever tasks are created by custom plugins. See Task Configuration Avoidance.

Thirdly, your own gradle build script looks not including any statements about variant.getMergeResources(), but this doesn't mean that your gradle plugins applied also don't include reference to variant.getMergeResources, so you need to look into all of your plugins, e.g.

apply plugin: 'com.android.application'
apply plugin: 'jacoco'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'

Probably above plugin implementation have at least one reference to the variant object.

Edit #1

Run below command to get the detailed build information about your project:

./gradlew build --scan

For example, you will see something like below

enter image description here

More about build troubleshooting can be found at Gradle Build Troubleshooting

shizhen
  • 12,251
  • 9
  • 52
  • 88
  • I comment this plugins `// classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'` and downgrade `google-services to 4.2.0` but getting error `Cause: buildOutput.apkData must not be null` – Deni Rohimat Sep 03 '19 at 07:25