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

Interaction with running flutter process exits prematurely on Windows #27

Open
jcs090218 opened this issue Aug 8, 2023 · 7 comments
Open
Labels
bug Something isn't working

Comments

@jcs090218
Copy link
Contributor

When I try flutter-run, then I got the following error:

More than one device connected; please specify a device with the '-d <deviceId>' flag, or use '-d all' to act on all devices.

<list of devices>

Process Flutter exited abnormally with code 1

Does this package support entering the device id?

@amake
Copy link
Owner

amake commented Aug 10, 2023

When I run flutter-run with multiple devices available, I get a prompt that lets me interactively choose the device:

Checking for wireless devices...

Connected devices:
Pixel 2 (mobile)           • xxxxxxxxxxxx              • android-arm64  • Android 11 (API 30)
Aaron’s iPhone Xꜱ (mobile) • xxxxxxxx-xxxxxxxxxxxxxxxx • ios            • iOS 16.6 20G75
Chrome (web)               • chrome                    • web-javascript • Google Chrome 115.0.5790.170
[1]: Pixel 2 (xxxxxxxxxxxx)
[2]: Aaron’s iPhone Xꜱ (xxxxxxxx-xxxxxxxxxxxxxxxx)
[3]: Chrome (chrome)
Please choose one (or "q" to quit): 1
1
Launching lib/main.dart on Pixel 2 in debug mode...
Running Gradle task 'assembleDebug'...                          

What versions of Flutter and Emacs are you using?

@jcs090218
Copy link
Contributor Author

I get a prompt that lets me interactively choose the device:

That's what I was expecting. I get the prompt in the terminal, but not with this package. 🤔

flutter --version:

Flutter 3.10.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f468f3366c (4 weeks ago) • 2023-07-12 15:19:05 -0700
Engine • revision cdbeda788a
Tools • Dart 3.0.6 • DevTools 2.23.1

Emacs 29.1 and on Windows 11.

@amake
Copy link
Owner

amake commented Aug 10, 2023

My best guess is that either Flutter or Emacs behaves differently on Windows.

flutter-run starts the flutter process with make-comint-in-buffer. I tried to look into how that works to see if there were any relevant code paths that might explain the difference, but I didn't see any.

At the moment the only workaround is this: #1 (comment)

@amake
Copy link
Owner

amake commented Aug 10, 2023

If you run (flutter-run "-d all") (or -d 1 or whatever), does the app start and can you interact with the flutter process with the usual keys? (r to refresh, etc.)

@jcs090218
Copy link
Contributor Author

If you run (flutter-run "-d all") (or -d 1 or whatever), does the app start

The app starts! But do we have to define the command ourselves? 🤔 It will be nice if we could just customize the arguments.

can you interact with the flutter process with the usual keys?

Yes, it works! However, it turns out I will get the same result in the first post (Process Flutter exited abnormally with code 1).

@amake
Copy link
Owner

amake commented Aug 10, 2023

It will be nice if we could just customize the arguments.

You can make your own function and bind it as you like, per the comment I linked earlier.

Yes, it works! However, it turns out I will get the same result in the first post (Process Flutter exited abnormally with code 1).

OK so it sounds like interactivity just doesn't work correctly on your setup. That's the real bug here, so I will keep this ticket open but clarify the title.

For improving the UI for choosing a device, see #1.

@amake amake changed the title Handle multiple devices Interaction with running flutter process exits prematurely on Windows Aug 10, 2023
@amake amake added the bug Something isn't working label Aug 10, 2023
@jcs090218
Copy link
Contributor Author

jcs090218 commented Aug 10, 2023

You can make your own function and bind it as you like, per the comment I linked earlier.

I mean, I was hoping for a built-in solution from this package, so I don't have to define it myself.

For improving the UI for choosing a device, see #1.

👍 Thank you for the reply. It's very helpful! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants