spoonconsulting / cordova-plugin-background-upload

Cordova plugin for background upload
Apache License 2.0
50 stars 53 forks source link

minCompileSDK(31) specified in a dependency's AAR metadata androidx.work:work-runtime:2.7.1 #203

Open Kcarpenter528 opened 2 years ago

Kcarpenter528 commented 2 years ago

Getting this error message when attempting to build on latest released plugin v4.0.2: Execution failed for task ':app:checkDebugAarMetadata'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction 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.work:work-runtime:2.7.1. AAR metadata file: .gradle/caches/transforms-3/73e09204760ea4755dc4d86cf2bf4d4f/transformed/work-runtime-2.7.1/META-INF/com/android/build/gradle/aar-metadata.properties.

Cordova CLI version 11 Cordova Android Platform: 10.1.1 Create brand new Cordova app: cordova create test_app com.test.app test_app Add Android platform: cordova platform add android Add only Spoon Consulting Plugin: cordova plugin add @spoonconsulting/cordova-plugin-background-upload Prepare/Build: cordova prepare && cordova build

zfir commented 2 years ago

Hello @Kcarpenter528,

Make sure you have set both compileSdkVersion and targetSdkVersion to 31 in your Gradle files.

Regards, Zafir.

nvahalik commented 2 years ago

Seeing the same issue here.

The targetSdkVersion must be 31 in your config.xml file, though the minSdkVersion can still be lower than that.

Additionally, there may be other projects that have to be updated. Some of the other plugins do not officially support Android 12 and as of writing this the release of cordova-android which officially supports Android 12 (10.1.2, 11.0.0) doesn't appear to have been released.

zfir commented 2 years ago

Hello @nvahalik,

You can review the updated demo project as we have updated the targetSdkVersion to 31, cordova-android and cordova to the lastest version. Everything is working fine. PR https://github.com/spoonconsulting/cordova-plugin-background-upload/pull/214.

Regrads, Zafir.