升级到gradle 3.3和android build tools 2.3.0时收到构建错误 [英] Receiving a build error when upgrading to gradle 3.3 and android build tools 2.3.0

查看:334
本文介绍了升级到gradle 3.3和android build tools 2.3.0时收到构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚更新了我的构建文件



Gradle从2.14.1到3.3
Android插件从2.2.3到2.3.0



我收到以下错误。看起来像一些第三方插件问题。任何人都可以点亮它吗?


配置项目':apis'时发生问题。



无法通知项目评估侦听器。



SDK中不再包含android命令。应该删除任何引用
(例如通过第三方插件)。


错误为抛出看起来像这样

  apply插件:'android-sdk-manager'
apply plugin:'com.android .library'
apply插件:'android-apt'

android {
compileSdkVersion Integer.parseInt(ANDROID_SDK_VERSION)
buildToolsVersion ANDROID_BUILD_TOOLS_VERSION

// Legacy apache网络堆栈
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 {
排除'LICENSE.txt'
排除'META-INF / LICENSE'
排除'META-INF / LICENSE.txt'
排除'META-INF / NOTICE'
}

lintOptions {
abortOnError false
}
}

...


解决方案

android-apt 已被弃用,并根据迁移指南


Android Gradle插件版本2.2,以前由android-apt提供的所有功能现已在Android插件中提供。


您可以删除 android-apt 并按照迁移指南获取等效功能。 同样,根据 sdk-manager-plugin page


这个插件已被弃用,不再使用 正在开发中。工具和依赖关系使用2.2.0版本自动下载 的Android Gradle插件或更新。


所以它也可以被删除。


I just updated my build files

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.

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.

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 has been deprecated and, as per the 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.

You can remove android-apt and follow the migration guide to get the equivalent functionality.

Similarly, as per the 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.

So it too can be removed.

这篇关于升级到gradle 3.3和android build tools 2.3.0时收到构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆