【问题标题】:im getting an error while adding Creative SDK DependenciesError:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'我在添加 Creative SDK DependenciesError 时遇到错误:任务“:app:transformResourcesWithMergeJavaResForDebug”的执行失败
【发布时间】:2016-08-04 11:19:22
【问题描述】:

我使用 firebase 和 creative SDK 创建了一个应用程序,起初我添加了 firebase 依赖项,它可以正常工作。之后我添加了创意 sdk 的依赖项并遇到了一些问题。

我在构建项目时遇到错误

错误:任务 ':app:transformResourcesWithMergeJavaResForDebug' 执行失败。 com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:在 APK META-INF/LICENSE.txt 中复制的文件重复 文件 1:C:\Users\Tharaka.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.4\5fe28b9518e58819180a43a850fbc0dd24b7c050\commons-lang3-3.4.jar 文件2:C:\Program Files\Android\Android Studio\gradle\m2repository\commons-io\commons-io\2.4\commons-io-2.4.jar

这是我的 gradle 项目文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        /* 1) Add the Gradle Retrolambda Plugin */
        classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta3'
    }
}

allprojects {
    repositories {
        jcenter()
        /* 2) Add mavenCentral */
       // mavenCentral()

        /* 3) Add the Creative SDK Maven repo URL */
        maven {
            url 'https://repo.adobe.com/nexus/content/repositories/releases/'
        }
        maven {
            url 'http://dl.bintray.com/raphaelbussa/maven'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

和我的应用程序 gradle 文件

apply plugin: 'com.android.application'

/* 1) Apply the Gradle Retrolambda Plugin */
apply plugin: 'me.tatarka.retrolambda'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.sliit.dailyselfie"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

    /* 2) Compile for Java 1.8 or greater */
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }


    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/DEPENDENCIES'
        pickFirst 'AndroidManifest.xml'


    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    compile 'com.github.flavienlaurent.datetimepicker:library:0.0.2'
    compile 'com.github.supervital:swipenumberpicker:1.0.3'
    compile 'com.android.support:cardview-v7:23.2.1'
    compile 'com.android.support:recyclerview-v7:23.2.1'
    compile 'com.wrapp.floatlabelededittext:library:0.0.6'
    compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
    compile 'com.firebase:firebase-client-android:2.3.1'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'info.hoang8f:fbutton:1.0.5'
    compile 'com.roughike:bottom-bar:1.2.4'
    compile 'rebus:bottom-dialog:0.0.5'

    compile 'com.adobe.creativesdk.foundation:auth:0.9.7'
    compile 'com.adobe.creativesdk:image:4.4.8'
}

【问题讨论】:

    标签: android firebase android-gradle-plugin maven-3 adobecreativesdk


    【解决方案1】:

    这已经被回答了,但答案似乎已经消失了……以防万一:

    尝试从你的 gradle 配置中删除这一行:

    exclude 'META-INF/LICENSE.txt'
    

    之后,尝试在 Android Studio 中清理/重建项目。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-30
      • 2016-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-17
      相关资源
      最近更新 更多