相关疑难解决方法(0)

Gradle with java 8 for retrolambda - Android无法找到注释TargetApi

我试图让retrolambda通过与gradle这个Android编译工作.对java 8的更改导致了android注释的一些问题.

我从这些帖子中尝试了几乎所有内容:(在阅读所有这些链接之前更新3)
http://code.google.com/p/android/issues/detail?id=55764
https://bitbucket.org/hvisser/ android-apt
AndroidAnnotations Nothing Generated,Empty Activity
Android studio + Gradle + Android Annotations
如何使用Google Android Gradle Plugin编译AndroidAnnotations?

但我一直得到这些错误:

Gradle:错误:包android.annotation不存在

Gradle:错误:找不到符号类TargetApi

那些gradle警告:

Gradle ::支持处理器'com.googlecode.androidannotations.AndroidAnnotationProcessor'支持的源版本'RELEASE_6'小于-source'1.8'

Gradle ::任何处理器都无法识别以下选项:'[androidManifestFile]'


这是我的build.gradle文件,使用/sf/answers/1176155151/(链接3最热门的解决方案):

buildscript {
    repositories {
        mavenCentral()
        maven { url 'http://download.crashlytics.com/maven' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
        classpath 'com.google.guava:guava:14.0.1'
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
        classpath 'me.tatarka:gradle-retrolambda:1.1.1'
    }
}

repositories {
    mavenCentral()
    maven { url 'http://download.crashlytics.com/maven' }
}

apply plugin: 'android'
apply plugin: 'crashlytics'
apply plugin: 'retrolambda'

ext.daggerVersion = '1.0.0'
ext.androidAnnotationsVersion = …
Run Code Online (Sandbox Code Playgroud)

android gradle java-8 android-annotations android-gradle-plugin

5
推荐指数
1
解决办法
5266
查看次数

在APK META_INF/NOTICE中复制的重复文件

我正在使用android studio版本0.5.8

我正在使用httpclient-android和httpmime将发布数据发送到http网址.

我的build.gradle文件:

apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
     }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.android.support:appcompat-v7:19.1.0'
    compile 'com.google.android.gms:play-services:+'
    compile 'org.apache.commons:commons-lang3:3.3.2'
    compile 'org.apache.httpcomponents:httpclient-android:4.3.3'
    compile 'org.apache.httpcomponents:httpmime:4.3.3'
}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误

Error:Execution failed for task ':myalcoholist:packageDebug'.
> Duplicate files copied in APK META-INF/NOTICE
File 1: /home/ufk/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.3.3/e02368d7b56c0c376f227378a4f77de62864d020/httpmime-4.3.3.jar
File 2: /home/ufk/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.3.3/e02368d7b56c0c376f227378a4f77de62864d020/httpmime-4.3.3.jar
Run Code Online (Sandbox Code Playgroud)

我试图删除.grandle目录并同步grandle,但我仍然得到相同的错误. …

android gradle android-studio android-gradle-plugin

3
推荐指数
1
解决办法
2882
查看次数

Android Gradle Dependency与Android提供的内部版本冲突

可能重复这个问题,虽然解决方案没有帮助我.

我讨厌复制/粘贴所有源代码,但似乎在gradle中没有办法:(因为这是第三天,我在我的代码处理,我把代码放在这里,并且我为这么多代码道歉...

我的主项目中有三个项目.因此我的settings.gradle看起来像这样:

include ':booking-sdk'
include ':booking-app-lib'
include ':booking-app'
Run Code Online (Sandbox Code Playgroud)

我的主build.gradle(在项目的根目录中)看起来像这样:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven { url 'http://download.crashlytics.com/maven' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
        classpath 'com.github.jcandksolutions.gradle:android-unit-test:2.1.1'
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven { url 'http://download.crashlytics.com/maven' }
        maven { url 'https://zendesk.artifactoryonline.com/zendesk/repo' }
    }
}

ext {
    ANDROID_SUPPORT = 'com.android.support:support-v4:20.0.0'
    CRASHLYTICS = 'com.crashlytics.android:crashlytics:1.+'

    androidConfiguration = {
        compileSdkVersion 21
        buildToolsVersion '21.1.2'

        defaultConfig {
            minSdkVersion 14
            targetSdkVersion 21
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }

        packagingOptions {
            exclude 'values/com_crashlytics_export_strings.xml' …
Run Code Online (Sandbox Code Playgroud)

android unit-testing gradlew android-studio android-gradle-plugin

3
推荐指数
1
解决办法
5635
查看次数

Android Studio + Gradle:java.lang.IllegalArgumentException

我有我的Gradle项目,并在build.gradle上声明我的依赖项:

dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'org.springframework.android:spring-android-auth:1.0.1.RELEASE'
compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
compile 'org.roboguice:roboguice:2.0'
Run Code Online (Sandbox Code Playgroud)

}

使用Gradle构建工作正常,但是当运行我的项目时,在编译阶段抛出以下错误:

Gradle: UNEXPECTED TOP-LEVEL EXCEPTION:
Gradle: java.lang.IllegalArgumentException: already added: Lorg/springframework/util/FileCopyUtils;
Gradle: at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
Gradle: at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
Run Code Online (Sandbox Code Playgroud)

我使用Gradle 1.8.

android gradle android-studio spring-android

1
推荐指数
1
解决办法
3059
查看次数