我有一个Android项目,使用gradle:2.1.0-alpha3版本之前的版本完美运行。现在它会抛出这些错误,但我不知道如何解决:
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.append(Ljava/lang/Iterable;)Lcom/google/common/collect/FluentIterable;
很奇怪,有一个特定的分支在过去四五天也会在apk中抛出重复的对象,详情请见
我的应用程序模块的build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-alpha5'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
allprojects {
repositories {
jcenter()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的模块的build.gradle文件:
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId "..."
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dataBinding {
enabled = true
}
lintOptions {
disable 'InvalidPackage'
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
//PixlUI
repositories {
maven {
url "https://jitpack.io"
}
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// Dagger 2
apt 'com.google.dagger:dagger-compiler:2.0.2'
provided 'org.glassfish:javax.annotation:10.0-b28'
//Autodagger
apt 'com.github.lukaspili.autodagger2:autodagger2-compiler:1.1'
provided 'javax.annotation:jsr250-api:1.0'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-wallet:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.dagger:dagger:2.0.2'
compile 'com.github.lukaspili.autodagger2:autodagger2:1.1'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'net.steamcrafted:materialiconlib:1.0.3@aar'
compile 'com.lorentzos.swipecards:library:1.0.9@aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.github.neopixl:PixlUI:v1.0.6'
compile 'com.scottyab:secure-preferences-lib:0.1.4'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'io.card:android-sdk:5.3.0'
compile 'com.paypal.sdk:paypal-android-sdk:2.13.1'
}
任何形式的帮助或指引都将不胜感激。