how to resolve ionic capacitor , The minCompileSdk (31) specified in a dependency's AAR metadata

Viewed 658

Hi i am facing issue in minCompileSdk (31) specified in a dependency's AAR metadata in ionic capacitor ,when i try to build capacitor app in android studio i got this issue, can anyone please help.

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-beta01.
AAR metadata file: C:\Users\username\.gradle\caches\transforms-2\files-2.1\6bf49fd8cef0098411b4a61e01232e22\appcompat-1.4.0-beta01\META-INF\com\android\build\gradle\aar-metadata.properties.
2 Answers

Add this into the build.gradle

configurations.all {
  resolutionStrategy {
    force 'androidx.appcompat:appcompat:1.3.1'
  }
}

For Capacitor ionic, I had to manually change the minCompileSDK at the following path from 31 to 30. C:\Users\yourUserFolder.gradle\caches\transforms-3\be06223ace9bb785a17b62c00389baa4\transformed\browser-1.4.0\META-INF\com\android\build\gradle\aar-metadata.properties

Related