我刚刚更新了我的构建文件
从 2.14.1 升级到 3.3 Android 插件从 2.2.3 到 2.3.0
我收到以下错误。似乎是一些第三方插件问题。任何人都可以阐明它吗?我在更改日志中找不到与此更改相关的任何内容。
A problem occurred configuring project ':apis'.
Failed to notify project evaluation listener.
The "android" command is no longer included in the SDK. Any references to it (e.g. by third-party plugins) should be removed.
抛出错误的构建文件看起来像这样
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
已被弃用,并且根据 migration guide :
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
并按照迁移指南获取等效功能。
同样,根据 sdk-manager-plugin page :
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.
所以它也可以被移除。
关于android - 升级到 gradle 3.3 和 android 构建工具 2.3.0 时收到构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42571034/