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

Lost connection to device on save #26945

Closed
pdefuns opened this issue Jan 23, 2019 · 34 comments
Closed

Lost connection to device on save #26945

pdefuns opened this issue Jan 23, 2019 · 34 comments
Labels
c: crash Stack traces logged to the console customer: crowd Affects or could affect many people, though not necessarily a specific customer. P2 Important issues not at the top of the work list platform-ios iOS applications specifically t: hot reload Reloading code during "flutter run" tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@pdefuns
Copy link

pdefuns commented Jan 23, 2019

Steps to reproduce:

  • Start app in debug mode
  • Do any change in the code and save (hot reload)
  • App crashes
Launching lib/main.dart on iPhone XS in debug mode...
Xcode build done.                                            8.2s
Reloaded 23 of 717 libraries in 3’584ms.
Lost connection to device.
Exited (sigterm)

I didn't update and have this issue since yesterday. Any ideas?

flutter doctor -v
[✓] Flutter (Channel beta, v1.0.0, on Mac OS X 10.14.2 18C54, locale de-CH)
    • Flutter version 1.0.0 at /Users/defuns/Development/Tools/flutter
    • Framework revision 5391447fae (8 weeks ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/defuns/Library/Android/sdk
    • Android NDK at /Users/defuns/Library/Android/sdk/ndk-bundle
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/defuns/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.30.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.21.1

[✓] Connected device (2 available)
    • Philippe  • 00008020-000A615C11E2002E            • ios • iOS 12.1.2
    • iPhone XS • 3B2D3077-9F8D-43A6-B013-71ABC41CC464 • ios • iOS 12.1 (simulator)

• No issues found!
@zoechi
Copy link
Contributor

zoechi commented Jan 23, 2019

Perhaps https://github.com/flutter/flutter/wiki/Workarounds-for-common-issues#hot-reload-not-working

Can you please try to get more information using these instructions #20998 (comment)

@zoechi zoechi added c: crash Stack traces logged to the console platform-ios iOS applications specifically waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds tool Affects the "flutter" command-line tool. See also t: labels. t: hot reload Reloading code during "flutter run" labels Jan 23, 2019
@pdefuns
Copy link
Author

pdefuns commented Jan 23, 2019

@zoechi I was not able to get the logs from XCode but I got them from the Simulator itself (Debug > Open System Log...)

I cleaned the log after startup and this is what's logged on save.

Jan 23 13:54:37 philippe-macbook-pro com.apple.CoreSimulator.SimDevice.8215D839-35A9-4573-A99C-ACA63767F281[58358] (com.apple.securityuploadd): Service only ran for 5 seconds. Pushing respawn out by 5 seconds.
Jan 23 13:54:37 philippe-macbook-pro com.apple.CoreSimulator.SimDevice.8215D839-35A9-4573-A99C-ACA63767F281[58358] (UIKitApplication:com.yapeal.core[0xf9a4][58380][66817]): Service exited due to SIGSEGV | sent by exc handler[66817]

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 23, 2019
@zoechi
Copy link
Contributor

zoechi commented Jan 23, 2019

You are not by any chance use a proxy or self-signed certificates?

@zoechi
Copy link
Contributor

zoechi commented Jan 23, 2019

Try manually uninstall from the phone/simulator and run flutter clean.

@MisterJimson
Copy link

I started seeing this about 3 weeks ago. Very often I get Lost Connection when hot reloading on iOS.

I've tried flutter clean and uninstalling the app.

@MisterJimson
Copy link

I just see.

Performing hot reload...
Syncing files to device iPad Air 2...
Lost connection to device.

And the app is left frozen.

@zoechi
Copy link
Contributor

zoechi commented Jan 24, 2019

You can raise priority with thumbs-up on the initial comment
https://github.com/flutter/flutter/wiki/Issue-hygiene#thumbs-up-reactions

@zoechi zoechi added this to the Goals milestone Jan 24, 2019
@genert
Copy link

genert commented Jun 17, 2019

Bump.

@MisterJimson
Copy link

I no longer am seeing this issue as of around Flutter 1.5

@hetkpatel
Copy link

hetkpatel commented Jun 18, 2019

I am on version 1.5.4 and having this issue. As soon as I run my app, it says Syncing files to device... then says Lost connection to device

I have tried to reboot Android Studio and my laptop but nothing seemed to work.

@aiman5252
Copy link

I am on version 1.5.4 and having this issue. As soon as I run my app, it says Syncing files to device... then says Lost connection to device

I have tried to reboot Android Studio and my laptop but nothing seemed to work.

Me too, It's my first time building flutter on MacOS and right after my app launched the log says Lost connection to device.

@nielslbeck
Copy link

Same behavior for me. MacOS and after launch, it loses the connection to the device.

@mtin79
Copy link

mtin79 commented Jun 22, 2019

+1
Same issue here.

Just did: $ flutter upgrade
Now running a freshly created flutter app via vscode in debug mode doesn't hot reload any longer and

i get the error:
"Lost connection to device."

@zmhbh
Copy link

zmhbh commented Jun 25, 2019

+1 Same issue here.

Just did: $ flutter upgrade
Now running a freshly created flutter app via vscode in debug mode doesn't hot reload any longer and

i get the error:
"Lost connection to device."

Same here as well. "Lost connection to device." immediately after launch. Hot reloading not working properly

@aeriu
Copy link

aeriu commented Jun 25, 2019

Same here as well. "Lost connection to device." immediately after launch. Debugging is not working.
Even after downgrading to 1.5.0 I get the same error message!

@daniel-v
Copy link

I too experienced this. Tried mostly everything I could find on the internet. Tried

  • NO_PROXY=127.0.0.1,localhost; flutter run -v,
  • turned off debugging over WiFi in XCode
  • killed iTunes and disabled syncing
  • switched cables (original iPhone cables)
  • switched iPhones (both iPhone X, iOS v 12.3.1)

Versions:

Mac OS Mojave 10.14.5
XCode 10.2.1
MacBook Pro 2016
iOS 12.3.1
Flutter 1.5.4, Flutter beta, even tried on some older 1.0+ versions

I think, the error message is a tad misleading; I don't think flutter command runner could make connection to the observatory at all, however I don't have any evidence to this.

After a few attempts, there are a number of iproxy instances "stuck", as though flutter run didn't terminate normally.

What worked without hickup is running the same app on Android device.

For now, just a wild idea is that docker virtual interfaces might be interfering?

@daniel-v
Copy link

daniel-v commented Jun 25, 2019

Update:

after killing all docker related services and removed the networks created for docker, the error has changed from lost connection to device to Error connecting to service protocol.

@YAPPDEF do you also use docker or do you have any other virtual machine on your computer that has it's own interfaces?

error

@sendwich
Copy link

sendwich commented Jun 25, 2019

Tried all of these, still can't debug on a physical device.

Lost connection to device.

Solutions??

@passol1988
Copy link

passol1988 commented Jun 26, 2019

+1
Same issue here.
Mac OS Mojave 10.14.5
XCode 10.2.1
when I connect a device

@elixiao
Copy link

elixiao commented Jun 27, 2019

Same problem. Every time I run flutter run, it loses connection to the device immediately after app launch.

$ flutter run
Launching lib/main.dart on LX in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: HD5523TJD5
Running Xcode build...                                                  
                                                   
 ├─Assembling Flutter resources...                           2.5s
 └─Compiling, linking and signing...                         3.7s
Xcode build done.                                            8.3s
Installing and launching...                                        13.0s
Syncing files to device LX...                                       
 2,587ms (!)                                       

🔥  To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
An Observatory debugger and profiler on LX is available at: http://127.0.0.1:1024/lhuDWtJTrdo=/
For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".
Lost connection to device.

@follyxing
Copy link

follyxing commented Jun 27, 2019

Same problem +1

image

MacOS Mojave 10.14.5
iOS 12.3.1

Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c334 • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

@luisabreuacevedo
Copy link

+1
Same issue here.

Flutter 1.5.4-hotfix.2
MacOS Mojave 10.14.5
Xcode 10.2.1

@najeira
Copy link
Contributor

najeira commented Jun 28, 2019

#35102 (comment) is a workaround for this. see that.

@daniel-v
Copy link

daniel-v commented Jul 1, 2019

#35102 (comment) is a workaround for this. see that.

This seem to have fixed both MacOS installs I knew of that had this problem. Single note: iproxy instances were stuck, computer restart was needed.

@genert
Copy link

genert commented Jul 11, 2019

This issue is fixed. Please close this.

@myvsparth
Copy link

myvsparth commented Jul 19, 2019

You can check stackoverflow answer. This may solve your problem
Flutter: “Lost connection to device” error after Hot Reload

@TheKashe
Copy link

TheKashe commented Aug 2, 2019

I'm getting this in Android Studio, with usbmux updated. VSC works.

So for me, with Android Studio, this is not closed.

@seb-almeida
Copy link

seb-almeida commented Aug 7, 2019

+1 Same here, still having this issue.

macOS Mojave 10.14.6
Xcode 10.2.1
Flutter 1.7.8+hotfix.4
Intellij Idea 2019.2 with Flutter Plugin 38.1.4

Update:
Went through the instructions again carefully and did manage to get it working on the terminal. Still failing on Intellij IDEA for some reason.

@MisterJimson
Copy link

I still see this from time to time as well, using Android Studio.

[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88,
    locale en-CA)
 
[✓] Android toolchain - develop for Android devices (Android SDK version
    28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2)
[✓] Android Studio (version 3.5)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.4)
[✓] VS Code (version 1.40.0)
[✓] Connected device (1 available)

• No issues found!

@jmagman jmagman added this to Awaiting triage in Tools - hot reload review Jan 10, 2020
@CedYF
Copy link

CedYF commented Jan 22, 2020

I'm getting this as well after doing Flutter Upgrade.

@muhammadfaisal970
Copy link

getting Lost connection to device after upgrading using flutter upgrade!

@TahaTesser TahaTesser added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label Mar 24, 2020
@GeorgeKnap
Copy link

I am getting the same behavior and it turns out it works if you disable automatic opening of dart devtools in chrome. (applies to lost connection to device in vscode)

https://stackoverflow.com/a/59748306/5790305

@weipeng-huang
Copy link

I am also got the same issue as below,

huangweipeng@huangweipengs-MacBook-Pro colorful_classroom_app % flutter run
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running Xcode build...

└─Compiling, linking and signing... 9.6s
Xcode build done. 21.4s
Waiting for iPhone 11 Pro to report its views... 3ms
Lost connection to device.
Syncing files to device iPhone 11 Pro...

@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label May 29, 2020
@jonahwilliams
Copy link
Member

There are a lot of unrelated issues posted in this thread, unfortunately that is making it impossible to tell what is tracking. Generally this could happen if the application crashes, but then we need a stack trace to figure out what is happening.

Without a way to reproduce the issue on our end there is nothing for us to do here. I'm closing the issue for now, but feel free to re-open if you can provide a minimal reproducible-example

Tools - hot reload review automation moved this from Awaiting triage to Engineer reviewed Jul 6, 2020
@flutter flutter locked as off-topic and limited conversation to collaborators Jul 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console customer: crowd Affects or could affect many people, though not necessarily a specific customer. P2 Important issues not at the top of the work list platform-ios iOS applications specifically t: hot reload Reloading code during "flutter run" tool Affects the "flutter" command-line tool. See also t: labels.
Projects
Tools - hot reload review
  
Engineer reviewed
Development

No branches or pull requests