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) New version of AS. . .
1. JDK17
2. AGP8.0, mine is only 7.1+
1,No variants found for ':app'. Check build files to ensure at least one variant exists. at:
online solution
The Android SDK Build-tools version does not match. Go to the Settings of the AS to download the SDK-related configuration you need, but it does not work for me.
java - No variants found for 'app'. Check build files to ensure at least one variant exists: Android Studio - Stack Overflow
Sharing my workaround:
repositories {
flatDir {
dirs 'libs'
}
// maven {
// url "http://dl.bintray.com/jlmd/maven"
// }
}
2、manifest merger failed with multiple errors see logs
Go to Terminal and enter the following command to view the specific Log
./gradlew processReleaseManifest --stacktrace
Solution: In addition to adding attributes to the manifest file, please check the project and Model and the three-party dependent SdkVersion versions to keep as consistent as possible
3、module java.base does not “opens java.io“ to unnamed module
Add the following code
maven {
url "https://jitpack.io"
}
mavenCentral()