在APK中复制的重复文件

问题描述 投票:0回答:2

我有这个错误

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK com/j256/ormlite/core/LICENSE.txt       
File1: ../.gradle/caches/modules-2/files-2.1/com.j256.ormlite/ormlite-core/4.48/e579bd2905d0399af5029aaaf9817d5fa0ca88a5/ormlite-core-4.48.jar  
File2: ../utils-lib/build/intermediates/bundles/default/classes.jar     
File3: ../networking-lib/build/intermediates/bundles/default/classes.jar
android android-gradle build.gradle
2个回答
2
投票

添加到build.gradle:

packagingOptions {
    exclude '**/LICENSE.txt'
    exclude 'pom.xml'
}

但你可以只排除com/j256/ormlite/core/LICENSE.txt而不是所有LICENSE.txt文件


0
投票

试试这个

exclude 'META-INF/ASL2.0'
© www.soinside.com 2019 - 2024. All rights reserved.