I just created a new Android Studio project, placed two buttons and wanted to run the app. But it didn't work out like the last time and threw these error messages:
´´´ FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction One or more issues found when checking AAR metadata values:
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.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 25s 22 actionable tasks: 22 executed
The build scan was not published due to a configuration problem.
The Gradle Terms of Service have not been agreed to.
For more information, please see https://gradle.com/help/plugin-terms-of-service.
Alternatively, if you are using Gradle Enterprise, specify the server location. For more information, please see https://gradle.com/help/plugin-enterprise-config. ´´´
I also uninstalled Android Studio, but it didn't work. Does anyone know what to do? I'm pretty new to Android Studio and Gradle. Thank you!
CodePudding user response:
The minCompileSdk is 31, but the minSdkVersion is significantly lower. Increasing the compileSdk of your project is enough to fix the issue.
android {
compileSdk 31
...
}