我想在我的android应用程序中使用lwjgl-opengles。当我添加Gradle时:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'org.lwjgl:lwjgl-opengles:3.1.0'
}
编译时出现以下错误:
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/INDEX.LIST
File1: /root/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengles/3.1.0/34022551efca063f31282f9952c29bdd41cb3c15/lwjgl-opengles-3.1.0.jar
File2: /root/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.1.0/fae7a04425666311d5dfe5ef7d89021ca0308d8d/lwjgl-3.1.0.jar
如何解决这个问题呢?谢谢!
将排除添加到您的gradle
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/INDEX.LIST'
}
}