manifest merger failed with multiple errors see logs(已解决)
Android Studio 2022.2.1项目迁移报错1、No variants found for ':app'. Check build files to ensure at least one variant exists. at:,2、manifest merger failed with multiple errors see logs,3、module java.base does not “opens java.io“ to unnamed module。
PS:(2022.2.1)新版AS。。。
1,JDK17
2,AGP8.0,我仅更为7.1+
1,No variants found for ':app'. Check build files to ensure at least one variant exists. at:
网上解决方案
Android SDK Build-tools版本不匹配,去AS的Settings下载自己需要的SDK相关配置,但对我不生效。
java - No variants found for 'app'. Check build files to ensure at least one variant exists: Android Studio - Stack Overflow
分享我的解决方法:
repositories {
flatDir {
dirs 'libs'
}
// maven {
// url "http://dl.bintray.com/jlmd/maven"
// }
}
2、manifest merger failed with multiple errors see logs
去Terminal输入以下命令查看具体Log
./gradlew processReleaseManifest --stacktrace
解决:除了清单文件添加属性之外,请检查项目以及Model和三方依赖SdkVersion版本尽量保持一致
3、module java.base does not “opens java.io“ to unnamed module
1,添加以下代码
maven { url 'https://jitpack.io' }
2,升级自己的AGP版本。。即可解决
#Thu Dec 22 18:17:29 CST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
classpath 'com.android.tools.build:gradle:7.1.2'
3,有些github拉取的项目依旧无法运行,尝试更改JDK来解决
4,有些项目可尝试升级 ext.kotlin_version版本号
ext.kotlin_version = "1.6.10" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"