一、Cause: duplicate entry: META-INF/MANIFEST.MF
1、解决方案
在android studio编译ijkplayer时出现该问题:
Cause: duplicate entry: META-INF/MANIFEST.MF一般为 工程目录build:gradle文件 classpath 'com.android.tools.build:gradle:3.5.3'版本的原因。
可以把build:gradle的版本进行调整,网上有把3.5.2调成3.5.3的,偶把3.5.2调成3.4.2,结果成功编译运行。
二、
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveEAndroid编译异常: duplicate entry: META-INF/MANIFEST.MF`或Entry name 'META-INF/MANIFEST.MF' collided
解决办法:
1.新版本AndroidStudio解决办法:(该方法不行就使用下面的旧版本方法试试)
注意:修改的是 项目的根目录下的settings.gradle文件内容
pluginManagement {repositories {gradlePluginPortal()google()mavenCentral()maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }maven { url "https://jitpack.io" }}
}
dependencyResolutionManagement {repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)repositories {google()mavenCentral()maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }maven { url "https://jitpack.io" }}
}
rootProject.name = "My Application"
include ':app'
2.旧版本AndroidStudio用下面的办法:
注意:修改的是 项目的根目录下的build.gradle文件内容
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {repositories {maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }jcenter()maven { url "https://jitpack.io" }}
}allprojects {repositories {maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }jcenter()maven { url "https://jitpack.io" }}
}