Repository navigation
Exception when running default app on Samsung Galaxy Note 5 #6280
Description
Error message
Seeing a strange behavior for the Galaxy Note 5 only when running the hello world application created by running flutter create. After a reboot of the phone, I can launch the application as expected. But trying to run the same application again for the 2nd time, the app gets stuck at the Flutter Debug Loader screen, with the message: "This is a hot-reload-enabled debug-mode Flutter application...".
The behavior is tied to the hot reload feature, when I disable it by using flutter run --no-hot, everything is working fine on the Galaxy Note 5.
Exception / error message shown: I've seen this exception a couple of times, but that doesn't seem to be the main problem, since the app get's stuck with different error messages as well.
0 ms • I/flutter : ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
0 ms • I/flutter : The following ArgumentError was thrown during performLayout():
0 ms • I/flutter : Invalid argument(s): 0.0
On an Nvidia Shield tablet or Lumigon T3 Android phone everything is working fine. These are the engine and framework revisions:
When running the app as a release using flutter run --release, it launches as expected.
Steps to Reproduce
On a Galaxy Note 5 (Android 6.0.1, build MMB29K.N920SKSU2BPH3), run the following steps:
- Reboot the phone
- Create a new default app using
flutter create helloworld. - Run the app by executing
flutter run lib/main.dartorflutter run: Application should run as expected - Stop the app and run again: Application launches with black screen, or with the "Flutter Debug Loader" screen (This is a hot-reload-enabled debug-mode Flutter application...").
- Now run the app with hot reload disabled:
flutter run --no-hot, and the app will load again.
Logs
flutter run -v output:
Running app after a reboot of device for the first time (everything working fine)
https://gist.github.com/raju-bitter/080e446a570c512133936bbc35e245b0
Running app for second time, now it doesn't launch, stuck at loader screen
https://gist.github.com/raju-bitter/5e978edbf03145715039d7ae2ec193b2
flutter analyze output:
Analyzing lib/main.dart...
No analyzer warnings! (ran in 5.7s)
Flutter Doctor
[✓] Flutter (on Linux, channel master)
• Flutter at /home/raju/dev/flutter
• Framework revision 6777766d2d (57 minutes ago), 2016-10-11 15:51:35
• Engine revision e8d046e9e2
• Tools Dart version 1.20.0-dev.10.2
[✓] Android toolchain - develop for Android devices (Android SDK 24.0.3)
• Android SDK at /home/raju/Android/Sdk
• Platform android-24, build-tools 24.0.3
• Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
[✓] Atom - a lightweight development environment for Flutter
• flutter plugin version 0.2.6
• dartlang plugin version 0.6.40
[-] IntelliJ WebStorm (version 2016.2)
• Dart plugin not installed; this adds Dart specific functionality.
• Flutter plugin not installed; this adds Flutter specific functionality.
• For information about managing plugins, see
https://www.jetbrains.com/help/idea/2016.2/managing-plugins.html
[✓] Connected devices
• SM N920S • 05157df5d93b793d • android-arm
Activity
eseidelGoogle commentedon Oct 12, 2016
For extra long logs like this gist.github.com can be useful for taking them out-of-band. :)
eseidelGoogle commentedon Oct 12, 2016
Looks like the first exception was:
eseidelGoogle commentedon Oct 12, 2016
Presumably that's a bug in TextPainter? @Hixie
raju-bitter commentedon Oct 12, 2016
Moved the log files into gist.github.com. Updated the description with more details after more testing. Was never able to reproduce that behavior on the two other Android devices I'm testing with.
Hixie commentedon Oct 14, 2016
@johnmccutchan the updated description suggests maybe hot reload is failing on the note 5?
johnmccutchan commentedon Oct 14, 2016
@Hixie the DevFS failure in the log is a result of the VM process dying while we are copying files.
@raju-bitter Do you have any idea what all the filesystem errors (ENOTEMPTY, ENOENT) are coming from? I've never seen that and it appears to be coming from the Android system directly.
johnmccutchan commentedon Oct 14, 2016
@eseidelGoogle Do we have a Galaxy Note 5?
sethladd commentedon Oct 14, 2016
We have a Note 3 and a Galaxy S5.
raju-bitter commentedon Oct 15, 2016
Did a factory rest of Galaxy Note 5 and tried again. Same behavior as before, here are the log files:
Testing flutter.io on Galaxy Note 5 after factory reset, 1st run of app with one hot reload
https://gist.github.com/raju-bitter/2dbaf3e5a92b261d6b0aef564c94f00b
Testing flutter.io on Galaxy Note 5 after factory reset, 2nd of app (error)
https://gist.github.com/raju-bitter/b3ac3e535cb5cd5e19b421c840c4d547
The 2nd time I'm running the app, I can see this extra exception:
https://gist.github.com/raju-bitter/b3ac3e535cb5cd5e19b421c840c4d547#file-flutter-run-log-galaxy-note5-factoryreset-second-run-log-L911
sethladd commentedon Oct 17, 2016
Thanks for double checking. I'll purchase a Note 5 right now.
Update: phone ordered. :)
mit-mit commentedon Oct 19, 2016
This also repros if you run a Flutter app from the IntelliJ plugin against a Nexus 5X (but not if you run that same app against that same 5X from a terminal with
flutter run): flutter/flutter-intellij#289.Some kind of timing issue?
stevemessick commentedon Oct 19, 2016
I can also reproduce this problem on a Nexus 5X using flutter daemon; see my comment in the bug @mit-mit referenced.
johnmccutchan commentedon Oct 20, 2016
@raju-bitter On the second run the HttpException is caused by the app on the phone crashing. It's unclear why it is crashing, I'm trying to reproduce locally with no luck. Could you gather the full logs from 'adb logcat' ? It might give us a clue about where the crash is occurring.
johnmccutchan commentedon Oct 20, 2016
Looking at the logs I noticed the first error:
It's unclear from the stack trace what is happening but this happens before we even create the DevFS environment.
johnmccutchan commentedon Oct 20, 2016
@raju-bitter I have made a change to flutter tools that will hopefully give a better stack trace for the above error. Could you sync to the latest master and try again?
raju-bitter commentedon Oct 21, 2016
@johnmccutchan Did another test run with today's version
[✓] Flutter (on Mac OS, channel master)
• Flutter at /Users/raju/dev/flutter
• Framework revision 729efa2 (12 hours ago), 2016-10-20 23:28:30
• Engine revision 5e78e75
• Tools Dart version 1.21.0-dev.0.0
Here is the complete log after rebooting and launching the Flutter app two times. First time reloading is working. Second time stuck, Flutter exception highlighted:
https://gist.github.com/raju-bitter/059c12d52cc7557648154d5b5e778e76#file-flutter-run-log-galaxy-note5-factoryreset-better-logging-txt-L1455-L1720
sethladd commentedon Oct 21, 2016
Thanks! Our Note 5 arrived, and it's on John's desk :)
johnmccutchan commentedon Oct 21, 2016
I can confirm that I can reproduce the failure as described. It's flaky but I can make it happen.
Initial investigation points at a low level networking failure between the host machine and the phone. We fail to make the initial service protocol connection. The client receives and HTTP error but the server (running on the phone) never sees the connection attempt. Possibly something bad is happening at the adb level.
johnmccutchan commentedon Nov 1, 2016
I've figured out what causes this problem: we get stale device logs and try and use the previous launch's service protocol port.
johnmccutchan commentedon Nov 1, 2016
After a few attempted runs, I see the following from
adb forward --list. Note the repeated device ports.sethladd commentedon Nov 1, 2016
Nice! Thanks for tracking it down :)
Roll engine a8890fd to 8471862 (#22153)
github-actions commentedon Sep 5, 2021
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
flutter doctor -vand a minimal reproduction of the issue.Manually filter old android device log messages instead of relying on…