chemerisuk / cordova-plugin-web-share

Web Share API polyfill for Cordova
MIT License
13 stars 9 forks source link

Failed to build in android targetSdkVersion<31 #15

Closed mhzendehpey closed 1 year ago

mhzendehpey commented 1 year ago

In android, targetSdkVersion must be greater than 30.

It can be fixed by adding the following line to platform/android/gradle.properties:

cdvSdkVersion=32

more info

chemerisuk commented 1 year ago

API Level 32 is requirement at January 2023 (https://developer.android.com/google/play/requirements/target-sdk).

mhzendehpey commented 1 year ago

You are right, but when I added android platform to my Cordova project via cordova platform add android, the installed cordova-android version was 10.1.2 and at this version, the default SDK version was 30 (more). I had to manually fix the target SDK version to 31 or 32, or update cordova-android to v11.x.x, again manually. The problem is the PendingIntent.FLAG_MUTABLE which is added in API Level 31 and makes the project fail to build and cannot be resolved. I believe it is not this plugin's issue, but I guess it is good to mention this requirement.