Syquel / mise-android-sdk

mise / asdf plugin for Android SDK (Android Command-line tools)
Apache License 2.0
2 stars 0 forks source link

Can't list versions #9

Closed Its-Alex closed 6 months ago

Its-Alex commented 6 months ago

Describe the bug

I can't list version of android-sdk, I have an error:

$ mise --verbose ls-remote android-sdk
[DEBUG] ARGS: mise --verbose ls-remote android-sdk
[DEBUG] Config {
    Config Files: [
        "~/Documents/iziplay-front/.mise.toml",
        "~/.mise.toml",
        "~/.config/mise/config.toml",
    ],
}
[DEBUG] $ git -C /home/alexandre.marre/.local/share/mise/plugins/android-sdk -c safe.directory=/home/alexandre.marre/.local/share/mise/plugins/android-sdk config --get remote.origin.url
[DEBUG] remote url for /home/alexandre.marre/.local/share/mise/plugins/android-sdk: https://github.com/Syquel/mise-android-sdk.git
[DEBUG] $ /home/alexandre.marre/.local/share/mise/plugins/android-sdk/bin/list-all
Error:
   0: Failed listing remote versions for plugin android-sdk
   1: error running list-all: exited with code 3
      Error: 2:3: invalid input text "# Extract availa..."
      asdf-android-sdk: Failed to parse Android SDK tool metadata
      asdf-android-sdk: Could not parse Android SDK tool metadata

Location:
   src/plugins/external_plugin.rs:197

Version:
   2024.4.8 linux-x64 (d04339c 2024-04-23)

Suggestion: Run with --verbose or MISE_VERBOSE=1 for more information.

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Steps to reproduce

$ mise plugins install android-sdk https://github.com/Syquel/mise-android-sdk.git
$ mise ls-remote android-sdk

I'm asking myself if ANDROID_SDK_MIRROR_URL should be defined, if it should can you help me fill it?

Thanks in advance.

Its-Alex commented 6 months ago

With that doesn't work too:

$ ANDROID_SDK_MIRROR_URL=https://dl.google.com/ mise ls-remote android-sdk
mise Failed listing remote versions for plugin android-sdk
mise error running list-all: exited with code 2
curl: (22) The requested URL returned error: 404
asdf-android-sdk: Could not download Android SDK metadata from https://dl.google.com//repository2-3.xml
asdf-android-sdk: Could not fetch Android SDK metadata
mise Run with --verbose or MISE_VERBOSE=1 for more information
$ ANDROID_SDK_MIRROR_URL=https://mirros.neusoft.edu.cn mise ls-remote android-sdk
mise Failed listing remote versions for plugin android-sdk
mise error running list-all: exited with code 2
curl: (6) Could not resolve host: mirros.neusoft.edu.cn
asdf-android-sdk: Could not download Android SDK metadata from https://mirros.neusoft.edu.cn/repository2-3.xml
asdf-android-sdk: Could not fetch Android SDK metadata
mise Run with --verbose or MISE_VERBOSE=1 for more information
Syquel commented 6 months ago

Which version of yq are you using?
I just tested a few older yq versions and 4.41.1+ should work.

I am not sure if I want to backport this plugin to lower yq versions, because I would lose the ability to provide comments in those scripts, which would make it unmaintainable.

For reference: yq 4.41.1 Release Notes

Its-Alex commented 6 months ago

Oh you're right that was yq versions that was causing the error. Now I have another errors when I try to install sdk:

$ mise install
Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
        java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
asdf-android-sdk: Failed to test validity of /home/alexandre.marre/.local/share/mise/installs/android-sdk/13.0/cmdline-tools/13.0/bin/sdkmanager:
asdf-android-sdk: An error occurred while installing Android SDK Command-line tools 13.0.
mise ~/.local/share/mise/plugins/android-sdk/bin/install failed
* Installing android-sdk release 13.0...
Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
        java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
asdf-android-sdk: Failed to test validity of /home/alexandre.marre/.local/share/mise/installs/android-sdk/13.0/cmdline-tools/13.0/bin/sdkmanager:
asdf-android-sdk: An error occurred while installing Android SDK Command-line tools 13.0.
mise ~/.local/share/mise/plugins/android-sdk/bin/install exited with non-zero status: exit code 5
mise Run with --verbose or MISE_VERBOSE=1 for more information
Syquel commented 6 months ago

Android SDK 9+ requires Java 17, but you are using Java 11.

Its-Alex commented 6 months ago

That's it, thanks you for the resolution! Sorry I don't use java frequently.

What do you think about adding the minimum required version of yq in the readme for the next persons that will use this repository?

Syquel commented 6 months ago

Thanks for the suggestion!
I added the minimum required versions of all dependencies to the readme.