bluetech opened a new issue, #1982: URL: https://github.com/apache/cordova-android/issues/1982
# Bug Report ## Problem I tried setting `<preference name="android-targetSdkVersion" value="37" />` in my config.xml, however the build requirements check then fails. ### What is expected to happen? The requirements check should pass, the appropriate SDK should be used. ### What does actually happen? The requirements check fails: ``` npm notice run 'cordova' prepare android Discovered platform "android". Adding it to the project Using cordova-fetch for [email protected] Adding android project... Creating Cordova project for the Android platform: Path: platforms/android Package: com.pcentra.ravkavonlinemobiletest Name: [STAGING] Rav-Kav Online Activity: MainActivity Android Target SDK: android-37 Android Compile SDK: 37 <snip> npm notice run 'cordova' requirements android Requirements check results for android: Java JDK: installed 17.0.19 Android SDK: installed true Android target: not installed Please install the Android SDK Platform "platforms;android-37" Gradle: installed /usr/share/java/gradle/bin/gradle Some of requirements check failed ``` ## Information I do have the Android 37.0 and 37.1 SDKs installed: ``` $ android sdk list platforms/android-37.0 2.0.0 Android SDK Platform 37.0 platforms/android-37.1 1.0.0 Android SDK Platform 37.1 ``` I believe the problem occurs because there is no `platforms/android-37`, just `platforms/android-37.0`. The code in [check_reqs.js](https://github.com/apache/cordova-android/blob/ed4e629e9da5721fdaa10dd6da5c85049723686e/lib/check_reqs.js#L44) takes the `android-targetSdkVersion` config (which correctly must be an integer, since `targetSdk` is an integer) and constructs `android-37` from it. I think the code would need to be adjusted to account for the `.0`/`.1` (maybe taking the latest, or allowing to choose?). ### Command or Code Set `<preference name="android-targetSdkVersion" value="37" />`, run a `cordova requirements android` check. ### Environment, Platform, Device Build environment, Linux. ### Version information Cordova CLI 13.0.0 Cordova Android 15.0.1 Android Studio 2026.1.2 ## Checklist - [x] I searched for existing GitHub issues - [x] I updated all Cordova tooling to most recent version - [x] I included all the necessary information above -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
