我剛剛創建了一個新的 Android Studio 專案,放置了兩個按鈕并想要運行該應用程式。但它沒有像上次那樣成功并拋出這些錯誤訊息:
′′′ FAILURE:構建失敗,出現例外。
- 出了什么問題:任務“:app:checkDebugAarMetadata”的執行失敗。
執行 com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction 時發生故障檢查 AAR 元資料值時發現一個或多個問題:
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.appcompat:appcompat:1.4.0.
AAR metadata file: C:\Users\elias\.gradle\caches\transforms-3\6c44282e022cd3a9cbc870646694ab0a\transformed\appcompat-1.4.0\META-INF\com\android\build\gradle\aar-metadata.properties.
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.appcompat:appcompat-resources:1.4.0.
AAR metadata file: C:\Users\elias\.gradle\caches\transforms-3\68cb3fa1e8cc28bcefb0e641636adeb7\transformed\jetified-appcompat-resources-1.4.0\META-INF\com\android\build\gradle\aar-metadata.properties.
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.emoji2:emoji2-views-helper:1.0.0.
AAR metadata file: C:\Users\elias\.gradle\caches\transforms-3\11f816c6396ec05574f231a43fe2fe51\transformed\jetified-emoji2-views-helper-1.0.0\META-INF\com\android\build\gradle\aar-metadata.properties.
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.emoji2:emoji2:1.0.0.
AAR metadata file: C:\Users\elias\.gradle\caches\transforms-3\f3f3fbf95d792df4fdb767de361ba6d6\transformed\jetified-emoji2-1.0.0\META-INF\com\android\build\gradle\aar-metadata.properties.
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.core:core:1.7.0.
AAR metadata file: C:\Users\elias\.gradle\caches\transforms-3\94786a0692ca429b2403ede1513a9cc7\transformed\core-1.7.0\META-INF\com\android\build\gradle\aar-metadata.properties.
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.lifecycle:lifecycle-process:2.4.0.
AAR metadata file: C:\Users\elias\.gradle\caches\transforms-3\4104eafb35ec41197ba4898ae753e255\transformed\jetified-lifecycle-process-2.4.0\META-INF\com\android\build\gradle\aar-metadata.properties.
The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.lifecycle:lifecycle-runtime:2.4.0.
AAR metadata file: C:\Users\elias\.gradle\caches\transforms-3\c726bc0560b0638acbd3117252a1943f\transformed\lifecycle-runtime-2.4.0\META-INF\com\android\build\gradle\aar-metadata.properties.
嘗試:使用 --stacktrace 選項運行以獲取堆疊跟蹤。使用 --info 或 --debug 選項運行以獲得更多日志輸出。使用 --scan 運行以獲得完整的見解。
在https://help.gradle.org獲取更多幫助
此版本中使用了已棄用的 Gradle 功能,使其與 Gradle 8.0 不兼容。使用“--warning-mode all”來顯示單個棄用警告。請參閱https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD 在 25 秒內失敗 22 個可操作的任務:22 個已執行
由于配置問題,構建掃描未發布。
尚未同意 Gradle 服務條款。
有關更多資訊,請參閱https://gradle.com/help/plugin-terms-of-service。
或者,如果您使用的是 Gradle Enterprise,請指定服務器位置。有關更多資訊,請參閱https://gradle.com/help/plugin-enterprise-config。'''
我也卸載了Android Studio,但沒有用。有誰知道該怎么做?我對 Android Studio 和 Gradle 還很陌生。謝謝!
uj5u.com熱心網友回復:
minCompileSdk 為 31,但 minSdkVersion 明顯更低。增加專案的 compileSdk 足以解決問題。
android {
compileSdk 31
...
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/398941.html
