2

I have a Gradle task on my app-level build.gradle file. Gradle warning tells me that this method is deprecated variant.getJavaCompiler(). But I can't find any documentation for variant.getJavaCompileProvider() array method.

API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'. It will be removed in version 5.0 of the Android Gradle plugin. For more information, see https://d.android.com/r/tools/task-configuration-avoidance.

And the task is:

afterEvaluate {
    android.applicationVariants.all { variant ->
        variant.javaCompiler.dependsOn externalSources, buildCoreVersion
    }
    Gradle gradle = getGradle()
    String tskReqStr = gradle.getStartParameter().getTaskRequests().toString().toLowerCase()
    if (tskReqStr.contains("huawei")) {
        apply plugin: 'com.huawei.agconnect'
    }
}

1 Answers1

0

Update your classpath dependency in project level Gradle:

buildscript {
// ... repositories, etc. ...

dependencies {
    // ...other dependencies ...
    classpath 'io.fabric.tools:gradle:1.30.0'
}}

By the way before asking for help try to find it on google this question is already answered here:-

https://stackoverflow.com/a/55703788/13694485

PRANAV SINGH
  • 1,000
  • 11
  • 17