?Android Studio 2022.2.1項(xiàng)目遷移報錯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:
網(wǎng)上解決方案
Android SDK Build-tools版本不匹配,去AS的Settings下載自己需要的SDK相關(guān)配置,但對我不生效。
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
解決:除了清單文件添加屬性之外,請檢查項(xiàng)目以及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拉取的項(xiàng)目依舊無法運(yùn)行,嘗試更改JDK來解決文章來源:http://www.zghlxwxcb.cn/news/detail-461761.html
4,有些項(xiàng)目可嘗試升級 ext.kotlin_version版本號??文章來源地址http://www.zghlxwxcb.cn/news/detail-461761.html
ext.kotlin_version = "1.6.10" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
到了這里,關(guān)于module java.base does not “opens java.io“ to unnamed module(已解決)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!