2016-11-08 107 views
0

我想在我的android應用程序中使用lwjgl-opengles。 當我添加在搖籃:將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 

如何解決這個問題呢?謝謝!

回答

0

附加排除以將gradle這個

android {  
    packagingOptions { 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'META-INF/INDEX.LIST' 
} 
}