当我打开并运行Android Studio时,从一开始就显示这些错误。

huangapple go评论51阅读模式
英文:

When I open and run Android Studio, it displays these errors from the very beginning

问题

6个问题在检查AAR元数据时被发现:

compileSdk 31

    defaultConfig {
        applicationId "com.example.lifecycle"
        minSdk 21
        targetSdk 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

以上方法不起作用。在更改最小SDK和最大SDK后,此错误增加到16个错误;
英文:

6 issues were found when checking AAR metadata:

enter image description here

compileSdk 31

defaultConfig {
    applicationId "com.example.lifecycle"
    minSdk 21
    targetSdk 30
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

The above method did not work.
This error increases to 16 errors when changing the minimum SDK and maximum SDK ;

答案1

得分: 0

确保项目中的所有依赖项都是最新版本。
确保项目中使用的依赖项是兼容的。
确保你的 Gradle 版本是最新的。
确保项目的 "build.gradle" 文件中使用的 "google()" 仓库被正确定义。
尝试重新构建项目:选择 "Build -> Clean Project"。
尝试清除 Gradle 缓存:选择 "File -> Invalidate Caches / Restart -> Invalidate and Restart"。

英文:

Make sure all dependencies in the project are at the latest version.
Make sure the dependencies used in the project are compatible.
Make sure your Gradle version is at the latest.
Make sure that the "google()" repository used in the project's "build.gradle" file is correctly defined.
Try rebuilding the project: select "Build -> Clean Project".
Try clearing the Gradle cache: select "File -> Invalidate Caches / Restart -> Invalidate and Restart".

>example

implementation 'androidx.core:core-ktx:1.8.0'

must be the samemust be the same

compileSdk 31
targetSdk 31

huangapple
  • 本文由 发表于 2023年2月14日 04:23:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/75440825.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定