相关疑难解决方法(0)

"Gradle版本2.10是必需的." 错误

正如我一直在使用

classpath 'com.android.tools.build:gradle:+'
Run Code Online (Sandbox Code Playgroud)

build.gradle文件中,由于gradle版本2.10已发布,因此出现以下错误.错误是:

警告:需要Gradle版本2.10.目前的版本是2.8.如果使用gradle包装器,请尝试将C:\ Users\blahblah\myproject\gradle\wrapper\gradle-wrapper.properties中的distributionUrl编辑为gradle-2.10-all.zip

起初它很容易被指南解决,但是当我完成更改后,我再次收到错误.

我正在使用Android Studio 2.0和最新的Android SDK Tools 24.4.1以及Android SDK Build Tools 23.0.2

我甚至尝试下载Gradle 2.10并将其手动放在android-studio\gradle \文件夹中,但没有运气.

任何帮助,将不胜感激.

plugins android gradle android-studio android-gradle-plugin

246
推荐指数
8
解决办法
18万
查看次数

lint任务上的gradle构建失败

我有一个简单的Android项目,我用Android Studio 0.4.0创建.我使用Gradle 1.9和Gradle Android插件0.7.昨天我在我的gradle构建脚本中添加了Jake Wharton的ButterKnife库:

dependencies {
            compile 'com.android.support:support-v4:19.0.0'
            compile 'com.android.support:appcompat-v7:19.0.0'

            // Butterknife
            compile 'com.jakewharton:butterknife:4.0.1'
}
Run Code Online (Sandbox Code Playgroud)

当我从Android Studio运行应用程序时,构建运行正常并在我的设备上正确执行.但是当我尝试(从命令行)时gradle build,构建失败.这是我的皮棉报告中的一部分:

InvalidPackage: Package not included in Android

/home/yami/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/4.0.1/f43b36925363701633d01adb8e54df7150397a78/butterknife-4.0.1.jar: Invalid package reference in library; not included in Android: javax.annotation.processing. Referenced from butterknife.internal.InjectViewProcessor.
/home/yami/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/4.0.1/f43b36925363701633d01adb8e54df7150397a78/butterknife-4.0.1.jar: Invalid package reference in library; not included in Android: javax.annotation.processing. Referenced from butterknife.internal.InjectViewProcessor.
/home/yami/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/4.0.1/f43b36925363701633d01adb8e54df7150397a78/butterknife-4.0.1.jar: Invalid package reference in library; not included in Android: javax.annotation.processing. Referenced from butterknife.internal.InjectViewProcessor.
/home/yami/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/4.0.1/f43b36925363701633d01adb8e54df7150397a78/butterknife-4.0.1.jar: Invalid package reference in library; not included …
Run Code Online (Sandbox Code Playgroud)

android gradle android-gradle-plugin

94
推荐指数
6
解决办法
11万
查看次数

升级到Android Studio 2.0后,Gradle构建期间出现大量错误

最近,我将Android Studio从1.5升级到2.0,但从那时起我发现错误和警告的数量有所增加.大多数错误没有意义.有人可以帮忙:

AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"error","text":"(org.apache.commons.validator.ValidatorResources$1) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} …
Run Code Online (Sandbox Code Playgroud)

android android-studio

57
推荐指数
2
解决办法
2万
查看次数