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'
}
}