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
when running flutter run or start debugging in VS code, it only remains on the white screen and does not perform debugging or hot reload #18889
Comments
Looks like a dup of #18730 |
Although the symptom is the same, I don't think it's related to #18730 - that one has a crash in the output, but this one looks like it's just hung:
Though it's not clear how long for - some other issues show timeouts written to the output after 60 seconds. @Davidjaco15 Does yours show a timeout message after 60 seconds? Does the same thing happen in an empty project created with |
Is this still an issue in recent Flutter versions? |
Same problem here |
Based on comments in #18757 (comment), it seems like when we start the app, we never get an Observatory url in logs back from the device:
|
I noticed the listening service doesn't work
So I need to forward ports
Although the service is answering now, the app is still stuck on I'm using Debian in a Virtualbox machine. USB control was sent successfully to this virtual machine:
I suspect there is some kind of TCP connection issue between my virtual machine (that runs on NAT with IP 10.0.2.15) and the device. So I have a question: does the flutter app try to make any TCP connection? If yes so I can create port forwards between host and guest machines. |
@eduardobcastro Are you running on master and comfortable modifying the code locally temporarily? I think it'd be interesting to add additional if (debuggingOptions.buildInfo.isDebug || debuggingOptions.buildInfo.isProfile) {
observatoryUri = await observatoryDiscovery.uri;
printTrace('Received observatory URI $observatoryUri');
} This is called from inside |
If you delete the file |
Ok changes worked. But didn't get into the |
Didn't get into it, or didn't hit the If it's hanging on the |
|
Yes, it is hanging. |
@eduardobcastro Thanks for confirming - and based on the comments above, if you run logcat at the same time as this, you do see output like |
Yes. Port changes randomly. |
Very strange :/ Could you find the code further up that looks like this: final String result = (await runCheckedAsync(cmd)).stdout; And before it, add this delay: await new Future<void>.delayed(const Duration(seconds: 5)); It seems unlikely, but I think there may be a race here between us starting up |
After this I changed to 30 seconds and noticed that the message |
So if I understand correctly, a 5 second delay does not help but a 30 second delay resolves the issue? |
No. It didn't work. I mean that I needed to increase the delay to perceive that it only started to listen |
Ah, ok - I may have found something. Inside the if (!time.isAfter(_timeOrigin)) {
// Ignore log messages before the origin.
return;
} I wonder whether some of these conditions are being triggered (for example if the clocks aren't in-sync, I wonder if it'll think the event was too early and discard it). Could you try putting some Edit: This may be nonsense, since it looks like we call logcat to get the time at the start, but maybe it's worth checking in case there's some error in there. |
The |
Ok, I'm running out of ideas :) When you run |
Yes. I ran logcat inside the interactive adb shell. The problem seems to be with this command. |
@DanTup it didn't work here. |
@DanTup https://superuser.com/questions/1357708/android-adb-logcat-works-only-on-shell/1357929#1357929 |
Oh, good catch! I didn't think to upgrade to latest when you confirmed your version, since I was wondering if you were on an old version that might've been fixed. Seems like downgrading is a workaround for now; but I'll upgrade mine on Monday and see if I can repro and figure out why adding |
Hi, I'm the adb maintainer. @eduardobcastro could you confirm that with 28.0.1, |
@jmgao confirmed. It only works with the strace output:
|
@eduardobcastro Hmm. It looks like from the perspective of the adb client, the logcat command exited immediately with no output? It seems like whatever the problem is, it's somewhere on the device. Can you try the following command: |
Yes, it exits immediately with no output when I run This is the strace you asked:
In an interactive
|
@eduardobcastro I upgraded to the 28.0.1 but it sadly still doesn't repro on my Moto X Play so I can't test fixes locally. Based on the above, does changing the Flutter code to..: // Start the adb logcat process.
final List<String> args = <String>['shell', '-x', 'logcat', '-v', 'time']; ..solve the issue for you? You may also need to insert those two new args into the logcat call in @jmgao If the above works, does it seem like a reasonable workaround for Flutter to ship |
@eduardobcastro Looks like LG might have broken logcat when outputting to a non-terminal. My guess is that it's because stdout isn't getting flushed, either because logcat is crashing during exit, or someone added an explicit @DanTup Yeah, I think that should be safe. |
@jmgao Great, thanks for the info. I'll prepare a PR with the change and wait for @eduardobcastro to confirm it does actually work for him locally before merging. |
@eduardobcastro I think it's 28.0.1 that introduced the issue - does it work with that too (it does for me, but my phone doesn't have this problem). If it solves the issue there for you, I'll merge the fix in and we can consider this solved :-) And thanks for all the help troubleshooting! 👍 |
Sorry, my mistake. I tested on 28.0.1. |
Great, thanks! |
This should fix #18889 which may be related to `adb logcat` not working correctly in non-terminals on some LG devices. See #18889 (comment).
The fix has landed in master; if you're on master please do try |
I am getting no out when i type adb logcat on terminal but when i type adb shell -x logcat it works fine.How can i resolve this issue?I am using ubuntu 18.04 and LG M700.Also when i type adb --version it shows : |
That's fine, that's what Flutter uses now: Please file a new issue if you're seeing this, and capture a verbose log by running Dart: Capture Logs and selecting Flutter Run and then trying to launch your app. Thanks! |
This comment has been minimized.
This comment has been minimized.
adb logcat command is now working on terminal .I solved it using this advice: |
This comment has been minimized.
This comment has been minimized.
Everything is working fine even flutter.I am able to hot reload and hot restart now and files are correctly synced now.Before downgrading it was not the case.Although this works for me and i realise it may not work for you.I even created a new issue last week regarding this which is linked below.I have closed that issue as it has been solved. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
Logs
Davidjaco@LAPTOP-VVOFBQFS MINGW64 /c/Proyectos/prueba22
$ flutter doctor -v
[√] Flutter (Channel beta, v0.5.1, on Microsoft Windows [Versión 10.0.17134.112], locale es-MX)
• Flutter version 0.5.1 at C:\sdk2\flutter
• Framework revision c7ea3ca (4 weeks ago), 2018-05-29 21:07:33 +0200
• Engine revision 1ed25ca
• Dart version 2.0.0-dev.58.0.flutter-f981f09760
[√] Android toolchain - develop for Android devices (Android SDK 28.0.0)
• Android SDK at C:\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.0
• ANDROID_HOME = C:\Android\sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
• All Android licenses accepted.
[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 25.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[√] Connected devices (1 available)
• Ilium L910 • FM6DCMYT4DEMIV7H • android-arm • Android 6.0 (API 23)
The text was updated successfully, but these errors were encountered: