英文:
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:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论