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

后端 未结 20 2487
谎友^
谎友^ 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:09

    In my case I had to include several additional exclusions. It appears it doesn't like Regular expressions which would've made this a nice one-liner.

    android {
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES.txt'
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/dependencies.txt'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/license.txt'
            exclude 'META-INF/LGPL2.1'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/notice.txt'
        }
    }
    

提交回复
热议问题