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

后端 未结 20 2494
谎友^
谎友^ 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 08:59

    It's more than one error

    Under apply plugin: 'android-library'

    add this ::

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

    In case of duplicate files it's easy, look inside the JAR under the META-INF dir and see what's causing the error. It could be multiple. In my case Couchbase Lite plugin. As you add more plugins, you will need more exceptions

提交回复
热议问题