0

Tried all solutions from here and it still doesn't work. Can you help me? There is no case. I am using cordova 10.1.0

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.browser: browser: 1.4.0.

1 Answers1

1

You are using androidx.browser: browser: 1.4.0. version which has been compiled using targetSdkVersion 31. In order to use this, you need to make your app also compatible with version 31.
Go to build.gradle and update compileSdkVersion and targetSdkVersion

android {
    compileSdkVersion 31 // updated to 31

    defaultConfig {
        applicationId "myproject.name.testApp"
        minSdkVersion 21 
        targetSdkVersion 31  // updated to 31
        versionCode 1
        versionName "1.0"
    }
}

If you don't want update to version 31, you can downgrade your androidx.browser to androidx.browser:browser:1.3.0 , this runs on sdkVersion 30

Nitish
  • 3,075
  • 3
  • 13
  • 28
  • Thanks! Do you know any way to downgrade androidx.browser? It is not a dependency that I am using directly (it comes from when compiling cordova) – Matias Zamorano Nov 17 '21 at 13:32
  • Did you update the Cordova version? Or some other library version update. Some update library must be using the lastest version of androidx.browser try finding it and downgrade it's version. – Nitish Nov 17 '21 at 13:51
  • 1
    I finally could! I had to not only set the browser version 1.3, but also the work-version to 2.6.0 I added in the build.gradle (inside app) this: `def androidx_version = "1.3.0" implementation ("androidx.browser: browser: $ androidx_version") { force = true } def work_version = "2.6.0" implementation ("androidx.work:work-runtime-ktx:$work_version") { force = true }` Thanks again!! You saved me – Matias Zamorano Nov 17 '21 at 14:42