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

toolchain.avdmanager does not work in Windows 11 #25

Open
danidemi opened this issue Aug 27, 2024 · 1 comment
Open

toolchain.avdmanager does not work in Windows 11 #25

danidemi opened this issue Aug 27, 2024 · 1 comment

Comments

@danidemi
Copy link

danidemi commented Aug 27, 2024

In WIndows 11, (not using WLS) If you run:

ProcessRunner avdmanager = emu.toolchain.avdmanager(['list','avd']);

you get:

-------------------------
ProcessException: The system cannot find the file specified.

  Command: C:\Users\<.....>\AppData\Local\Android\Sdk\cmdline-tools/latest/bin/avdmanager list avd
-------------------------

If, .../emulators-0.6.1/lib/src/toolchain.dart:26, you change this:

final _avdmanagerPath = _which('avdmanager')
    .catchError((_) => _androidSdk
        .map((sdk) => P.join(sdk, 'cmdline-tools/latest/bin/avdmanager')))
    .getOrElse((_) => 'avdmanager');

to this:

final _avdmanagerPath = _which('avdmanager')
    .catchError((_) => _androidSdk
        .map((sdk) => P.join(sdk, 'cmdline-tools\\latest\\bin\\avdmanager.bat')))
    .getOrElse((_) => 'avdmanager');

it works!

The problem seems that in some way the class takes for granted it is running on Linux/Mac where in this case it is working on Windows.

Do you think you can make it works on both platforms?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@danidemi and others