0

When I use Android Studio as my ide, the app loads fine on the emulator. When I use VS Code, the app installs and opens but it's only a white page that is failing to load. I'm not sure what is going on. The only thing I could find about it was to add a line "NO_PROXY" somewhere but I don't know where or if that will even help. I have updated version of dart/flutter and VS Code. Any help would be appreciated!! Thanks!

user3648673
  • 45
  • 1
  • 8
  • Check this: https://stackoverflow.com/questions/1570627/how-to-set-up-android-emulator-proxy-settings – Maadhav Sharma Oct 20 '19 at 02:40
  • This link didnt seem to help me. According to my emulator settings, "NO_PROXY" is already selected and if it was a problem with the emulator, it probably wouldnt work on Android Studio but it does. – user3648673 Oct 20 '19 at 14:29

1 Answers1

0

This usually happens when the VS Code extension is unable to connect the debugger to the app on the device (this means it can't unpause it at startup - it's started paused so that breakpoints can be set before any code starts executing).

Common causes include:

  • Proxy servers, with 127.0.0.1/localhost not being excluded
  • iOS devices being debugged over WiFi (try disabling WiFi on the device temporarily and see if that seems to fix it)

The proxy fix is usually to set the NO_PROXY environment variable, but depending on where it's set, it may or may not be visible to the VS Code process (people often set this in their terminal startup scripts, but may then launch VS Code from outside of the terminal).

If disabling WiFi and setting NO_PROXY doesn't work, please file a bug on GitHub with verbose logs. You can collect verbose logs from VS Code by running the Dart: Capture Logs command and ticking the Flutter Run option.

Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
  • Thank you for your reply. Im not sure how to set the NO_PROXY environment variable. I know how to get to the environment variables in windows but it doesn't really make sense to me to set this at the windows system level. Especially since the emulator works when running from Android Studio. This seems to be only a VS Code issue. I can confirm that disabling wifi on the emulator does not help. I am also running Pie, not Q. Can you provide me with a link to step by step of where to set the NO_PROXY Variable to try it? – user3648673 Oct 20 '19 at 18:32
  • It makes perfect sense to set at the system level :) If you have a proxy server, it almost certainly should never be proxying localhost because localhost is not accessible to an off-machine proxy. Working in Android Studio *could* be that you're not running in debug mode, so it doesn't need to connect the debugger - though it's also possible this isn't proxy related. Running "Run Flutter Doctor" should tell you if you appear to have a proxy but don't have NO_PROXY set though. – Danny Tuppeny Oct 21 '19 at 06:43
  • If you don't get anywhere though, please do file an issue in Dart-Code on GitHub with the log mentioned above, and we can dig into it further. – Danny Tuppeny Oct 21 '19 at 06:43
  • Im sure its probably something dumb and easy but opened issue https://github.com/Dart-Code/Dart-Code/issues/2061 – user3648673 Oct 21 '19 at 16:21
  • Thanks! I'll follow up on the issue tomorrow. Unfortunately there are a lot of different things that can go wrong that cause this behaviour, so tracking down which one it is will involve some troubleshooting. – Danny Tuppeny Oct 21 '19 at 21:31