Home » Android » gradle – Android studio3.3 variantOutput.getProcessResources() is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()

gradle – Android studio3.3 variantOutput.getProcessResources() is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()

Posted by: admin June 15, 2020 Leave a comment

Questions:

What is bellow warning:

WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
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 variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Affected Modules: app
How to&Answers:

It’s the bug in https://services.gradle.org/distributions/gradle-4.10.1-all.zip .

You need to roll back to https://services.gradle.org/distributions/gradle-4.6-all.zip in gradle-wrapper.properties

And

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1' //roll back to this version

I have deal with this bug for 4 hours. I gave up so I rolled back to last version. It’s perfect now. So let’s wait for the newer version. Don’t upgrade, yet!

Answer:

run a gradle task with this flag -Pandroid.debug.obsoleteApi=true
and it will let you know where the obsolete feature is being used.

After identifying where the issue is, you can try updating as the message suggests

ex. .gradlew app:assembleDebug -Pandroid.debug.obsoleteApi=true

Answer:

I do not need to change the default of ” classpath ‘com.google.gms:google-services:4.2.0’ “. This is the default that I copy from firebase, it really has been updated but we do not need to update it.