gpt4 book ai didi

android - 我在添加 Creative SDK 依赖项时遇到错误错误 :Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'

转载 作者:行者123 更新时间:2023-11-30 01:24:30 25 4
gpt4 key购买 nike

我正在使用 firebase 和 creative SDK 创建一个应用程序,起初我添加了 firebase 依赖项并且它没有任何问题。之后我添加了创意 sdk 的依赖项并遇到了一些问题。

我在构建项目时遇到错误

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE.txt File1: C:\Users\Tharaka.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.4\5fe28b9518e58819180a43a850fbc0dd24b7c050\commons-lang3-3.4.jar File2: 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'
}

最佳答案

这个已经有人回答了,但是答案好像消失了……以防万一:

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

exclude 'META-INF/LICENSE.txt'

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

关于android - 我在添加 Creative SDK 依赖项时遇到错误错误 :Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36597089/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com