Android Gradle插件0.7.0:“在打包APK期间复制文件”

本文翻译自:Android Gradle plugin 0.7.0: “duplicate files during packaging of APK”

Using Android Gradle plugin 0.7.0 with the following build.gradle : 将Android Gradle插件0.7.0与以下build.gradle

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.0'
    }
}

apply plugin: 'android'

repositories {
    maven { url "https://android-rome-feed-reader.googlecode.com/svn/maven2/releases" }
    maven { url "http://dl.bintray.com/populov/maven" }
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion '18.1.1'

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19
    }
    buildTypes {
        release {
            runProguard true
            proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
        }
    }
    productFlavors {
        defaultFlavor {
            proguardFile 'proguard-rules.txt'
        }
    }
    sourceSets {
        instrumentTest.setRoot('src/instrumentTest')
    }
}

configurations {
    apt
}

ext.androidAnnotationsVersion = '2.7.1';

dependencies {
    compile 'com.android.support:support-v4:18.0.0'

    compile 'com.viewpagerindicator:library:2.4.1@aar'

    compile 'com.google.code.android-rome-feed-reader:android-rome-feed-reader:1.0.0-r2'
    compile 'org.jdom:jdom:1.1.1-android-fork'

    apt "com.googlecode.androidannotations:androidannotations:${androidAnnotationsVersion}"
    compile "com.googlecode.androidannotations:androidannotations-api:${androidAnnotationsVersion}"

    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.j256.ormlite:ormlite-android:4.47'
    compile 'com.j256.ormlite:ormlite-core:4.47'
    compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
    compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
    compile 'com.prolificinteractive:actionbarsherlock:4.3.1@aar'

    compile 'com.google.code.geocoder-java:geocoder-java:0.15'

    compile files('libs/CWAC-Pager.jar')
}

android.applicationVariants.all { variant ->
    aptOutput = file("${project.buildDir}/source/apt_generated/${variant.dirName}")
    println "****************************"
    println "variant: ${variant.name}"
    println "manifest:  ${variant.processResources.manifestFile}"
    println "aptOutput:  ${aptOutput}"
    println "****************************"

    variant.javaCompile.doFirst {
        println "*** compile doFirst ${variant.name}"
        aptOutput.mkdirs()
        variant.javaCompile.options.compilerArgs += [
                '-processorpath', configurations.apt.getAsPath(),
                '-AandroidManifestFile=' + variant.processResources.manifestFile,
                '-s', aptOutput
        ]
    }
}

gives the error Duplicate files copied in APK META-INF/LICENSE.txt : 给出错误, Duplicate files copied in APK META-INF/LICENSE.txt

WARNING: Dependency commons-logging:commons-logging:1.0.4 is ignored for defaultFlavorDebug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.0.4 is ignored for defaultFlavorRelease as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the clas
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值