【发布时间】:2017-12-15 17:52:04
【问题描述】:
对于我正在开发的 Android 项目,我需要* 使用 Eclipse Collections 框架。所以我根据他们的"get started"将它集成到我的build.gradle,并导入了需要的库。问题是,当我尝试在我的 Android 设备上运行该应用程序时,它会失败并显示以下消息:
错误:任务执行失败 ':app:transformResourcesWithMergeJavaResForDebug'。 发现多个文件具有独立于操作系统的路径“LICENSE-EDL-1.0.txt”
我在 Stackoverflow 上进行了一些谷歌搜索,并在 Stackoverflow 遇到了一些类似(尽管不相同)的问题,但没有一个建议的解决方案对我有用(其中大多数建议将 packagingOptions 添加到 build.gradle)。如果这很重要 - 我的应用使用 OpenCV4Android,我正在 Android Studio 中开发它。
另外,为了清楚起见,没有添加 Eclipse-Collections 一切都可以正常工作..
这是我的应用程序的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.example.android.coftest"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'org.eclipse.collections:eclipse-collections-api:9.0.0'
compile 'org.eclipse.collections:eclipse-collections:9.0.0'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.+'
compile 'com.android.support:support-vector-drawable:26.+'
testCompile 'junit:junit:4.12'
compile project(':openCVLibrary330')
}
* 这不是必须的,但它使我的代码更加简单和优雅,我真的很想拥有它。
【问题讨论】:
标签: java android android-gradle-plugin build.gradle eclipse-collections