Allow setting environment variables in flutterflutterCustomEmulators
See original GitHub issueLaunching the android emulator under arch linux, wayland and the sway wm results in it hanging for a minute and then failing to start with an error message :
Failed to launch Pixel: Error: Emulator didn't connect within 60 seconds
.
starting the emulator from the terminal by $ /opt/android-sdk/emulator/emulator @flutter_emulator
and seeing the error message
handleCpuAcceleration: feature check for hvf
emulator: INFO: QtLogger.cpp:68: Warning: Could not find the Qt platform plugin "wayland" in "/opt/android-sdk/emulator/lib64/qt/plugins" ((null):0, (null))
Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
((null):0, (null))
zsh: abort (core dumped) /opt/android-sdk/emulator/emulator @flutter_emulator
I have the following in my environment file to make QT applications launch under wayland QT_QPA_PLATFORM=wayland
. in order to make the android emulator work i have to prefix the emulator command with a env variable override like so
env QT_QPA_PLATFORM=xcb /opt/android-sdk/emulator/emulator @flutter_emulator
or simply just
QT_QPA_PLATFORM=xcb /opt/android-sdk/emulator/emulator @flutter_emulator
how can i make the dart extension launch the emulator with this override?
what i tried :
in my settings.json of vscode
"dart.flutterCustomEmulators": [
{
"id": "flutter_emulator",
"name": "Pixel",
"executable": "QT_QPA_PLATFORM=xcb /opt/android-sdk/emulator/emulator",
}
]
and
{
"id": "flutter_emulator",
"name": "Pixel",
"executable": "/opt/android-sdk/emulator/emulator",
"args":["QT_QPA_PLATFORM=xcb "]
}
]
both didn’t work. and the second attempt i knew was not going to work as the env override needs to happen at the begining of the command. could a way be provided to pass env variables overrides to the custom emulator configuration ?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top GitHub Comments
Hello @hossamdash and @DanTup !
I also run Manjaro with Sway, and have your problem, but I tried your settings and it did not work at all. I tried:
Or
@gusbemacbe you need to put them in the
env
key, something like this: