使用带有gradle插件版本的Android Studio 3.3 Canary 11 3.3.0-alpha11.尝试同步gradle时,它会引发以下错误
WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been
replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-
avoidance
Affected Modules: app
Run Code Online (Sandbox Code Playgroud)
单击错误会将我引导至gradle文件中的此行
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${variant.name}-${variant.versionName}.apk"
}
}
Run Code Online (Sandbox Code Playgroud)
我到底需要改变什么?
项目 build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral() // jcenter() works as well because it pulls from …Run Code Online (Sandbox Code Playgroud) android firebase android-studio android-gradle-plugin fabric.io
什么是波纹管警告:
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
Run Code Online (Sandbox Code Playgroud) 获得此警告(即使在variant.getAssemble()任何地方都没有使用):
API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
Run Code Online (Sandbox Code Playgroud)
我更新了以下组件:Android Studio
v3.3
Gradle PlugIn
v3.3
Gradle分发URL (gradle-wrapper.properties)
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
gradle.properties
android.debug.obsoleteApi=true