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

2023-05-25,,

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'
}
}
}

android异常 More than one file was found with OS independent path 'META-INF/XXX'的相关教程结束。

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

下载本文的Word格式文档,以方便收藏与打印。