No variants found for ‘:app‘. Check build files to ensure at least one variant exists. at: 2022.2.1

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相关配置,但对我不生效。

https://stackoverflow.com/questions/64682582/no-variants-found-for-app-check-build-files-to-ensure-at-least-one-variant-ex

分享我的解决方法:

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

添加以下代码

maven {
            url "https://jitpack.io"
        }
        mavenCentral()

猜你喜欢

转载自blog.csdn.net/weixin_45083704/article/details/130245013