skip to Main Content

I’m 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…Why?

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:UsersAfonso.gradlecachestransforms->346d15f5c58a469270eeba15db4463d05transformedappcompat-1.4.0META->INFcomandroidbuildgradleaar-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:UsersAfonso.gradlecachestransforms->370088de83757cd2e92dadb8b386e6adbtransformedjetified-appcompat-resources-1.4.0META->INFcomandroidbuildgradleaar-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:UsersAfonso.gradlecachestransforms->36cbed90352b213553df3539e2e7f22aftransformedjetified-emoji2-views-helper-1.0.0META->INFcomandroidbuildgradleaar-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:UsersAfonso.gradlecachestransforms->39b79be83fba3907471fe1de63f439d3transformedjetified-emoji2-1.0.0META->INFcomandroidbuildgradleaar-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:UsersAfonso.gradlecachestransforms->39339927e08badd09bc5459e4ba900d5ftransformedcore-1.7.0META-INFcomandroidbuildgradleaar->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:UsersAfonso.gradlecachestransforms->3e4a425e61d135d109d64d5f17d999dftransformedjetified-lifecycle-process-2.4.0META->INFcomandroidbuildgradleaar-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:UsersAfonso.gradlecachestransforms->3bca1bb61c15ab5807e64593ca04debeftransformedlifecycle-runtime-2.4.0META->INFcomandroidbuildgradleaar-metadata.properties.

3

Answers


  1. Try to change your build.gradle(app) file.
    Set compileSdkVersion and targetSdk to 30, and Sync your gradle file

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
  3. The minCompileSdk (31) specified in a dependency’s AAR metadata
    […] is greater than this module’s compileSdkVersion (android-30).

    The minimum compile SDK version of some of your dependencies are set to 31, while your app’s compile SDK is set to 30.

    You can simply raise your compileSdk version in module-level build.gradle to 31:

    android {
        compileSdk 31
    }
    

    Or you can leave that and instead use older versions of the dependencies you have trouble with. E.g. instead of

    implementation 'androidx.appcompat:appcompat:1.4.0'
    

    it would be

    implementation 'androidx.appcompat:appcompat:1.3.1'
    

    and so on…

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search