GitHub user breautek added a comment to the discussion: cordova requirements 
Command failed with ENOENT

> Why doesn't cordova notice when I change the java sdk version?

Cordova first checks and uses `CORDOVA_JAVA_HOME` environment variable if set, 
then falls back to `JAVA_HOME` (if I recall correctly.)

So if `CORDOVA_JAVA_HOME` or `JAVA_HOME` is set to a JDK 17 environment, it 
will use those binaries over say a `PATH` order. I'd also note that JDK 17 
would be the recommended environment to use as that's what Android Studio will 
use and their tools assumes a JDK 17 environment.  JDK 19 or later is not 
officially supported by the android SDK so mileage may vary there.

For what it's worth, I also get

```
Android target: not installed
Command failed with ENOENT: avdmanager list target
spawn avdmanager ENOENT
```

when running the requirements command, but cordova and android building still 
works, so those might be a bug with the requirements command itself, rather 
than the bug in the actual cordova-android platform.

> How can I tell it there are android targets on my system (supposing the 
> "platforms;android-xx" really are android targets"?

A workaround would be to use `sdkmanager` directly as you were already doing:

`$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list_installed`

And you're right, you're looking for `platforms;...` lines:

```
  platforms;android-33                                  | 3            | 
Android SDK Platform 33                    | platforms/android-33               
                  
  platforms;android-34                                  | 3            | 
Android SDK Platform 34                    | platforms/android-34  
```

In my case, I have both android API 33 and 34 installed. At this time, Cordova 
only supports API 33. API 34 support will be introduced in the upcoming 
cordova-android@13 release.

GitHub link: 
https://github.com/apache/cordova/discussions/469#discussioncomment-8708288

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscr...@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to