Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find compatible cmdline-tools for java version 21 #1852

Closed
7maucdn opened this issue Jul 30, 2024 · 10 comments
Closed

Unable to find compatible cmdline-tools for java version 21 #1852

7maucdn opened this issue Jul 30, 2024 · 10 comments

Comments

@7maucdn
Copy link

7maucdn commented Jul 30, 2024

After upgrade to 1.37.4 from 1.36.0, i can't run my test, it's raise error :

------------------ Shard 1 ------------------

Please specify a device platform [android, ios, web]:
android

Please specify Android version [34, 33, 31, 30, 29, 28]: Press ENTER for default (30)
34

❌ Error: BlockingCoroutine is cancelling
kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@5cf84f7e
Caused by: maestro.cli.CliError: Unable to find compatible cmdline-tools (/root/Android/cmdline-tools/<version>) for java version 21.

Try to install a different cmdline-tools version:
1) Open Android Studio SDK manager
2) Check "Show package details" to show all versions
3) Install Android SDK Command-Line Tools. Recommended version: latest
* https://developer.android.com/studio/intro/update#sdk-manager
        at maestro.cli.util.AndroidEnvUtils.requireCommandLineTools(AndroidEnvUtils.kt:74)
        at maestro.cli.device.DeviceService.requireAvdManagerBinary(DeviceService.kt:465)
        at maestro.cli.device.DeviceService.getAvailablePixelDevices(DeviceService.kt:348)
        at maestro.cli.device.DeviceCreateUtil.getOrCreateAndroidDevice(DeviceCreateUtil.kt:99)
        at maestro.cli.device.DeviceCreateUtil.getOrCreateDevice(DeviceCreateUtil.kt:16)
        at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:228)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
@Ekt0s

This comment was marked as spam.

@bartekpacia
Copy link
Member

bartekpacia commented Jul 31, 2024

Hey @7maucdn, sorry for the problems. Before we can resolve this issue we need more info though. Could you run these and share output with us?

java -version

and

$ANDROID_HOME/cmdline-tools/latest/source.properties

(in your case that'll be /root/Android/cmdline-tools/latest/source.properties

In the future, please follow the bug report template.

@bartekpacia bartekpacia added the waiting for customer response More information is needed from the customer before we can progress on the issue label Jul 31, 2024
@bartekpacia bartekpacia changed the title Can't run tests after upgrade to 1.37.4 from 1.36.0 Unable to find compatible cmdline-tools for java version 21 Jul 31, 2024
@bartekpacia
Copy link
Member

@7maucdn, did you try the suggestion that is in the error message you posted? That is, update to latest Android command-line tools?

@tutanjamon2020
Copy link

Hello. I'm having the same issue:

❌ Error: BlockingCoroutine is cancelling
kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@9966508
Caused by: maestro.cli.CliError: Unable to find compatible cmdline-tools (/home/XXXXX/Android/cmdline-tools/) for java version 21.

~/samples$ java -version
openjdk version "21.0.4" 2024-07-16
OpenJDK Runtime Environment (build 21.0.4+7-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (build 21.0.4+7-Ubuntu-1ubuntu222.04, mixed mode, sharing)

~/samples$ $ANDROID_HOME/cmdline-tools/latest/source.properties
/home/XXX/Android/cmdline-tools/latest/source.properties: line 1: Pkg.Revision=12.0: command not found
/home/XXX/Android/cmdline-tools/latest/source.properties: line 2: Pkg.Path=cmdline-tools: command not found
/home/XXX/Android/cmdline-tools/latest/source.properties: line 2: 12.0: command not found
/home/XXX/Android/cmdline-tools/latest/source.properties: line 3: Pkg.Desc=Android: command not found

@Ekt0s
Copy link

Ekt0s commented Aug 9, 2024

@7maucdn @bartekpacia the problem was coming from the file tree in ANDROID_HOME/cmdline-tools on my part.

I solved it by just updating the cmdline-tools package using the SDK wizard in Android Studio.
The latest version "16.0.0-rc1" fixes the issue 😃

On the previous version, I had a subfolder cmdline in ANDROID_HOME/cmdline-tools/latest/

@tutanjamon2020
Copy link

tutanjamon2020 commented Aug 10, 2024

Hi team. I have spent 4 days trying to do the initial configuration of Maestro. Quite frustrating experience.

I have not been able to solve it with any version of Java, nor with any version of cmd-line tool.

I currently have installed:
Java Version: openjdk version "21.0.4" 2024-07-16.
Command-Line Tool: Latest (16.0.0 rc1)
\wsl$\Ubuntu\home\damianaz\Android\cmdline-tools\latest:
Source Properties:
Pkg.Revision=16.0-alpha01
Pkg.Path=cmdline-tools;16.0-alpha01
Pkg.Desc=Android SDK Command-line Tools

Error:
kotlinx.coroutines.JobCancellationException: BlockingCoroutine is canceling; job=BlockingCoroutine{Cancelling}@3fa0c421
Caused by: maestro.cli.CliError: Unable to find compatible cmdline-tools (/home/damianaz/Android/cmdline-tools/) for java version 21.

Try to install a different cmdline-tools version:

  1. Open Android Studio SDK manager
  2. Check "Show package details" to show all versions
  3. Install Android SDK Command-Line Tools. Recommended version: latest
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I don't know what else to do.

@HAL9000Thomas
Copy link

HAL9000Thomas commented Aug 12, 2024

Experienced the same issue after upgrading to the latest Maestro CLI version. Installing cmdline-tools via Android studio seems not to be enough to fix the issue. My colleague also had this issue on his machine. Downgrading to CLI 1.34.1 worked for me.

@ggetorres

This comment was marked as off-topic.

@bartekpacia
Copy link
Member

Hey all – could you update your comments with more information?

The following will help debug:

cat $ANDROID_HOME/cmdline-tools/latest/source.properties

(Make sure you have $ANDROID_HOME env var properly set up)

And attach output of java -version.

@bartekpacia bartekpacia reopened this Aug 14, 2024
@mobile-dev-inc mobile-dev-inc deleted a comment from github-actions bot Aug 14, 2024
@mobile-dev-inc mobile-dev-inc deleted a comment from github-actions bot Aug 14, 2024
@bartekpacia bartekpacia removed the waiting for customer response More information is needed from the customer before we can progress on the issue label Aug 14, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.
Thank you for helping keep us our issue tracker clean!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants