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
dap-debug: The Android emulator exited with code 1 during startup #114
Comments
Thanks for the report, is this reproducible for the same project if you run |
Could you also get the output of the |
@ericdallo |
@prasanthkrishnan my guess is that is a issue with the debugger extension we use (the same for vscode), could you check if changing Also, could you try running in a different android emulator? just to check if the issue is not related to that emulator |
Do you have anyone in particular, I am new to android development! |
Same error?
Usually, I test with Nexus 5/Nexus 5x |
Wanted to confirm the steps, give me a sec, I will report back! |
After installing dap vs code extension 3.25.1 and running nexus 5 API 30 emulator i get the same error. The app runs without issues with |
Hum, I'd like to confirm if that could be a debugger issue. |
If it helps debugging, I am down for a screenshare session via discord / meet. |
I'm not very familiar with how things work in emacs-lsp so I'm not exactly sure what's wrong here. Is this issue when trying to launch the emulator, or run the app? These are two separate steps:
The error in the daemon logs looks related to starting the emulator but the description sounds like the issue is with running the app. If the issue is with launching the app, then a log of all the DAP traffic would be helpful (with |
@DanTup thank you! @prasanthkrishnan could you try creating a new launch configuration with that |
I added the following config.el and tried
There was no additional logs. What i noticed is this, for the first time the emulator is starting fine but the app is not starting after the emulator comes up. When i try
I think it because there is already an existing emulator. So the problem here looks like the app not starting on the emulator. Thoughts? @ericdallo @DanTup |
What happens if you run |
|
So it seems like starting the emulator works as long as it's not already running. @ericdallo how does starting the emulator work in lsp-dart? Is it part of starting the debug session or separate? If the same, does it check the device isn't already running before trying to start it? Could it be trying to load it each time, and this error preventing it from then starting the debug session via the DAP? |
Good point @DanTup @prasanthkrishnan, probably it's missing some check that use to not be a issue before on lsp-dart, @DanTup how Dart-Code check if the emulator is already running? I can try to implement the same check |
Dart-Code doesn't really launch on emulators, only on devices. So whenever you try to launch if there is an active device (or one explicitly specified), it will use that. If not, it shows a list of emulators and you can pick to launch one, but it just relies on the fact that it will shortly turn up in the device list when it's finished booting, so it will then auto-select that and use it. So it never really needs to know whether an emulator is running. However, it actually does check that, only to filter out the emulators from the emulator list that already have active devices (just to avoid confusion with emulators showing up twice - once as an (unbooted) emulator and once as a (running) device). It does this using the
|
Thank you @DanTup ! I'll try to improve that on lsp-dart side |
Hey @prasanthkrishnan I manage to reproduce the issue for emulators that were already running. |
I test the fix and it worked perfectly. |
Great, thanks for the details, debugging and help @DanTup @prasanthkrishnan |
Great! :-) Btw @ericdallo do you only ever use the Flutter version of Dart-Code's DAP, or also the Dart CLI one? I'm working on moving DAP to the SDK (and will migrate Dart-Code to it), though it'll likely be in two parts (the Dart part in the Dart SDK and Flutter part in the Flutter SDK). When it's a bit more complete it may be useful to have you try it out (it's had a little cleanup so some of the arguments passed are slightly different and it supports a better way for the editor to inform the DAP which folders are the users code). |
Oh good to know that! lsp-dart support both flutter debugger and dart debugger so I think it depends on both? |
Yes, there will be one :) I haven't documented it properly yet as it's not really ready for people to use (you currently have to run it from a clone of the SDK, but it should ultimately be some SDK command like Once there's a good way to start the DAP, I'll create a doc like the LSP one that includes what's supported and any custom fields/events/requests that are implemented. I'll ping you somewhere when that's the case :-) |
That sounds great! thank you very much! |
@ericdallo not sure if I'd mentioned this elsewhere, but using the current dev/master versions of Dart/Flutter, the SDK DAPs should be pretty good now. Info can be found here: Dart: https://github.com/dart-lang/sdk/blob/main/pkg/dds/tool/dap/README.md To start them, you can use |
@DanTup yes! I implemented it some weeks ago, and released a new lsp-dart version already using it, it looks awesome! |
We are basically checking flutter/dart version is supports that and using it behind a enabled flag by default: Line 198 in 01b5867
|
Great! I thought we'd discussed it somewhere, but couldn't see where (I found this notification in my mailbox waiting to be pinged 😄). |
Describe the bug
I am trying to setup my doom emacs for flutter development. I am trying to launch the flutter_sample project via M-x
dap-debug
. It launches the android emulator but doesnt run the app. The next time I run M-xdap-debug
I get the following errorI tried the following referring to this issue but still the problem persists.
export NO_PROXY=localhost,127.0.0.1
to zshrc fileTo Reproduce
Expected behavior
** M-x
dap-debug
should run the app and initialize a dap session.Version
Include here the result of: M-x
lsp-dart-version
[LSP Dart] 1.19.0 at 2021.08.15 @ Emacs 27.2
[Dart SDK] Dart SDK version: 2.13.4 (stable) (Wed Jun 23 13:08:41 2021 +0200) on "linux_x64"
[Flutter SDK] /home/zerocool/snap/flutter/common/flutter
[Flutter project] true
[Project entrypoint] /home/zerocool/workspace/flutter_sample/lib/main.dart
Thanks in advance for the help!.
The text was updated successfully, but these errors were encountered: