在编译和构建我的Android应用程序时,如下所示的错误不断发生。我一直在使用this堆栈溢出答案来解决错误并排除重复文件。
这是我尝试构建项目时遇到的错误。
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK com/google/appengine/repackaged/org/apache/commons/codec/language/bm/sep_approx_spanish.txt
File1: /Users/tomfinet/.gradle/caches/modules-2/files-2.1/com.google.appengine/appengine-api-1.0-sdk/1.9.28/e92c18272b555027d9ec666e7a89162f10638314/appengine-api-1.0-sdk-1.9.28.jar
File2: /Users/tomfinet/.gradle/caches/modules-2/files-2.1/com.google.appengine/appengine-endpoints/1.9.28/bf2e8a74bd28e388b3487fc78a0c7adfa592fd5d/appengine-endpoints-1.9.28.jar
当我按照stack overflow answer中的指示运行终端命令./gradlew dependencies
时,我应该看到我的项目的整个依赖关系树。
然而我所看到的只是:
Downloading https://services.gradle.org/distributions/gradle-2.10-all.zip
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Unzipping /Users/tomfinet/.gradle/wrapper/dists/gradle-2.10-all/a4w5fzrkeut1ox71xslb49gst/gradle-2.10-all.zip to /Users/tomfinet/.gradle/wrapper/dists/gradle-2.10-all/a4w5fzrkeut1ox71xslb49gst
Set executable permissions for: /Users/tomfinet/.gradle/wrapper/dists/gradle-2.10-all/a4w5fzrkeut1ox71xslb49gst/gradle-2.10/bin/gradle
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
Incremental java compilation is an incubating feature.
:dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
No configurations
BUILD SUCCESSFUL
Total time: 53.171 secs
This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.10/userguide/gradle_daemon.html
这是后端的gradle文件:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.28'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.28'
compile 'com.google.appengine:appengine-endpoints:1.9.28'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.28'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:5.0.3'
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}
那么如何解决依赖关系之间的这种冲突呢?我很确定我必须exclude
冲突的文件。但是,如何找到导致此问题的文件?