im trying to create an android app, but when i create an app, just the default "hello world" app that comes when you create a new project.
But when i try to build the default app it gives me this error...any help pls?
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\Afonso.gradle\caches\transforms->3\46d15f5c58a469270eeba15db4463d05\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\Afonso.gradle\caches\transforms->3\70088de83757cd2e92dadb8b386e6adb\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\Afonso.gradle\caches\transforms->3\6cbed90352b213553df3539e2e7f22af\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\Afonso.gradle\caches\transforms->3\09b79be83fba3907471fe1de63f439d3\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\Afonso.gradle\caches\transforms->3\9339927e08badd09bc5459e4ba900d5f\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\Afonso.gradle\caches\transforms->3\0e4a425e61d135d109d64d5f17d999df\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\Afonso.gradle\caches\transforms->3\bca1bb61c15ab5807e64593ca04debef\transformed\lifecycle-runtime-2.4.0\META->INF\com\android\build\gradle\aar-metadata.properties.
CodePudding user response:
Try to change your build.gradle(app) file.
Set compileSdkVersion
and targetSdk
to 30, and Sync your gradle file
CodePudding user response:
If you read the error messages carefully you can understand
The minCompileSdk (31) specified in a dependency's AAR metadata is greater than this module's compileSdkVersion (android-30).
One simple solution would be to go to gradle build(:app) and change the compileSdkVersion to 30
Go to search and type build gradle (:app)
It would look something like this
android {
compileSdkVersion 31
}
After the change it should be this
android {
compileSdkVersion 30
}
Change the targetSdkVersion under defaultConfig to 30
Like this:
defaultConfig {
targetSdkVersion 30
}
save and run
Happy coding!