私が開発している Android プロジェクトでは、Eclipse Collections フレームワークを使用する必要があります*。だから私は彼らの「始めよう」build.gradle
に従ってそれを私のものに統合し、必要なライブラリをインポートしました。問題は、Android デバイスでアプリを実行しようとすると、次のメッセージで失敗することです。
エラー:タスク ':app:transformResourcesWithMergeJavaResForDebug' の実行に失敗しました。OS に依存しないパス「LICENSE-EDL-1.0.txt」で複数のファイルが見つかりました
私はいくつかのグーグルを行い、ここ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')
}
* これは必須ではありませんが、コードをよりシンプルかつエレガントにします。