Anyone found a way to get flutter flavors working with android emulator? It causes issues for me.
I have added the “–flavor” “dev” to my previews.previews.android.command and doing so causes problems.
Anyone found a way to get flutter flavors working with android emulator? It causes issues for me.
I have added the “–flavor” “dev” to my previews.previews.android.command and doing so causes problems.
hm, I can’t seem to repro. Can you help us with a bit more details please? What issues are you seeing, any specific logs that you see. What happens if you run “flutter run --machine -d android -d localhost:5555 --flavor dev” manually in the termal?
To rule out emulator issues, can you list the devices with the command “adb devices” and make sure localhost:5555 is there please?
Sometimes, Flutter/ADB is late to detect devices. This issue can be resolved by waiting for a while and reloading the preview on the emulator, though it can be quite frustrating at times.
2024-09-17T05:25:13Z [android] <IDX> Starting preview...
2024-09-17T05:25:13Z [android] Flutter daemon started
2024-09-17T05:25:14Z [android] No supported devices found with name or id matching 'localhost:5555'.
2024-09-17T05:25:14Z [android] The following devices were found:
2024-09-17T05:25:14Z [android] Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
2024-09-17T05:25:14Z [android] Linux (desktop) • linux • linux-x64 • IDX GNU/Linux 6.1.100+
2024-09-17T05:25:14Z [android] <IDX> ✘ Preview failed to start
Thanks for the feedback. This is a known issue and we’re trying to improve how emulator states are handled. In the meanwhile, can you add a hook that waits for the device to be ready in dev.nix please? This should at least delay the preview start until emulator is ready
workspace = {
onStart = {
wait-for-adb =‘’
adb -s localhost:5555 wait-for-device
‘’
}
}