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

Flutter beta hot reload in VSCode works for Chrome but not iOS and Android (which works in Android studio) #2632

Closed
NixBiks opened this issue Jul 11, 2020 · 1 comment

Comments

@NixBiks
Copy link

NixBiks commented Jul 11, 2020

I'm running Mac Catalina and have both Android Studio and VSCode installed

❯ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.19.0-4.3.pre, on Mac OS X 10.15.5 19F101, locale en-GB)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.47.0)
[✓] Connected device (3 available)

• No issues found!

I have a very simple app

import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: Center(
        child: Text("Hello World!"),
      ),
    ),
  );
}

If I run the app from Android Studio then hot reload works just fine, e.g. changing the text and saving will update the text on any of the devices (iOS, Android or Chrome).

But if I do the same in VSCode, i.e. F5 (Debug: Start debugging), then hot reload only works for Chrome device. Looking in the debug console I see the following each time I make a change and save (on all devices).

Reloaded 1 of 502 libraries in 167ms.

But no updates on the screen (except when running Chrome where output in the debug console looks the same as with the others.). I find this very odd!

@NixBiks
Copy link
Author

NixBiks commented Jul 12, 2020

Oh my. I forgot to put the app inside a stateless app. My mistake!

@NixBiks NixBiks closed this as completed Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant