android异常 More than one file was found with OS independent path 'META-INF/XXX'

android 异常总结:一个文件在jar包中出现多次。

 

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

> More than one file was found with OS independent path 'META-INFXXX'

 

需要在app.gradle文件里面android节点下添加这样的代码

 

   packagingOptions {
        exclude 'META-INF/XXX'
  	exclude 'META-INF/XXX'
  	exclude 'META-INF/XXX'
  	exclude 'META-INF/XXX'
    }
	

 

 

 

具体的修改位置

 

apply plugin: '

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId ""
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    packagingOptions {
        exclude 'META-INF/XXXX'
    }


    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

 

 

 

 

 

欢迎大家关注【趣学程序】公众号

 

 

 

 

 

 

©️2020 CSDN 皮肤主题: 撸撸猫 设计师:设计师小姐姐 返回首页