0
点赞
收藏
分享

微信扫一扫

More than one file was found with OS independent path ‘META-INF/LICENSE.md‘(管用)

我是芄兰 2022-05-26 阅读 114

META-INF/LICENSE.md文件多余
解决:
在相应module的build.gradle中添加exclude

  packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.md'
exclude 'META-INF/LICENSE.md'
}

全代码参考

android {

compileSdkVersion build_version.compileSdkVersion

defaultConfig {

applicationId rootProject.ext.applicationId
minSdkVersion build_version.minSdkVersion
targetSdkVersion build_version.targetSdkVersion
versionCode build_version.versionCode
versionName build_version.versionName
testInstrumentationRunner build_version.testInstrumentationRunner


//Multidex subcontracting
multiDexEnabled true

javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
}


lintOptions {
abortOnError false
checkReleaseBuilds false
// Prevent build failed due to missingtranslation during publishing!
disable 'MissingTranslation'
}


//The default so file loading directory of Android studio is: Src / main / jnilibs
sourceSets {
main {
jniLibs.srcDirs = ['src/main/jniLibs']
}
}

buildTypes {
// release {
// minifyEnabled true
// zipAlignEnabled true
// shrinkResources true
// signingConfig signingConfigs.config
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// }

// debug {
// debuggable true
// minifyEnabled true
// zipAlignEnabled true
// shrinkResources true
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.config
// }
}

//Version output package name auto append version number and version name
applicationVariants.all {
variant ->
variant.outputs.all {
def createTime = new Date().format("MMdd", TimeZone.getTimeZone("GMT+08:00"))
// app包名称
outputFileName = "SmartNAS_V" + defaultConfig.versionName + "_" + "Phone" + "_" + createTime + ".apk"

}
}

dataBinding {
enabled = true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.md'
exclude 'META-INF/LICENSE.md'
}


}


举报

相关推荐

0 条评论