Android Gradle plugin 0.7.0: “duplicate files during packaging of APK”

后端 未结 20 2463
谎友^
谎友^ 2020-11-22 08:51

Using Android Gradle plugin 0.7.0 with the following build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }

    dependenci         


        
20条回答
  •  情歌与酒
    2020-11-22 09:23

    Important to know in what file it comes to this error (in you example it is META-INF/LICENSE.txt) , in my case it was in META-INF/LICENSE [without ".txt"], and then in the file META-INF/ASL2.0 so I added to my build.gradle this lines:

    android {
        packagingOptions {
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/ASL2.0'
        }
    }
    

    Very important (!) -> add the name of the file in the same style, that you see it in the error message: the text is case sensitive, and there is a difference between *.txt and *(without "txt").

提交回复
热议问题