問題描述
我剛剛更新了構建文件
從 2.14.1 升級到 3.3從 2.2.3 到 2.3.0 的 Android 插件
Gradle from 2.14.1 to 3.3 Android Plugin from 2.2.3 to 2.3.0
我收到以下錯誤.似乎是一些第三方插件問題.任何人都可以闡明它嗎?我在更改日志中找不到與此更改相關的任何內容.
I am receiving the following error. Seems like some thirdparty plugin issue. Can anyone shed light to it? I cant find anything in change logs related to this change.
配置項目 ':apis' 時出現問題.
A problem occurred configuring project ':apis'.
未能通知項目評估偵聽器.
Failed to notify project evaluation listener.
機器人"命令不再包含在 SDK 中.任何參考應該刪除它(例如通過第三方插件).
The "android" command is no longer included in the SDK. Any references to it (e.g. by third-party plugins) should be removed.
引發錯誤的構建文件如下所示
The build file in which error is thrown looks something like this
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.library'
apply plugin: 'android-apt'
android {
compileSdkVersion Integer.parseInt(ANDROID_SDK_VERSION)
buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
// Legacy apache network stack
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion Integer.parseInt(ANDROID_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(ANDROID_SDK_VERSION)
consumerProguardFiles 'proguard-rules.pro'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
}
lintOptions {
abortOnError false
}
}
...
推薦答案
android-apt
已被棄用,根據 遷移指南:
從 Android Gradle 插件版本 2.2 開始,之前由 android-apt 提供的所有功能現在都可以在 Android 插件中使用.
As of the Android Gradle plugin version 2.2, all functionality that was previously provided by android-apt is now available in the Android plugin.
您可以刪除 android-apt
并按照遷移指南獲取等效功能.
You can remove android-apt
and follow the migration guide to get the equivalent functionality.
同樣,根據 sdk-manager-plugin 頁面:
此插件已棄用,不再開發.使用 2.2.0 版自動下載工具和依賴項Android Gradle 插件或更新版本.
This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the Android Gradle plugin or newer.
所以它也可以被刪除.
這篇關于升級到 gradle 3.3 和 android build tools 2.3.0 時收到構建錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!