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

Code that works on case-insensitive file systems can/will fail on case-sensitive filesystems #9539

Closed
susch19 opened this issue Apr 22, 2017 · 15 comments
Labels
c: regression It was better in the past than it is now platform-windows Building on or for Windows specifically

Comments

@susch19
Copy link

susch19 commented Apr 22, 2017

Summary

I have this issues for a few days now and i could track it back to the commit #9424. Before that, the reload and hot reload worked fine and now it loses the connection to my device. I tried it with multiple physical and virtual devices (Android). On linux everything seems to work just fine.

Steps to Reproduce

  1. Create a new project
  2. Add a new Dart file, doesn't matter if empty or not
  3. Import Dart file into main.dart
  4. Try HotReload or FullReload

Verbose log

[  +24 ms] [E:\Flutter\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[  +36 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/master
[        ] [E:\Flutter\flutter\] git ls-remote --get-url origin
[  +19 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[        ] [E:\Flutter\flutter\] git log -n 1 --pretty=format:%H
[  +18 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[        ] ad496e142b9a1c114dea65e7d87e474cd85dd5c2
[        ] [E:\Flutter\flutter\] git log -n 1 --pretty=format:%ar
[  +16 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[        ] 4 hours ago
[ +215 ms] E:\Android\sdk\platform-tools\adb devices -l
[  +14 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb devices -l
[        ] List of devices attached
           9SYTGAZP99999999       device product:cm_mt6795 model:mediatek_mt6795 device:mt6795
[  +10 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 shell getprop
[  +96 ms] Launching lib/main.dart on mediatek mt6795 in debug mode...
[ +115 ms] Using gradle from C:\Program Files\Android\Android Studio\gradle\gradle-3.3\bin\gradle.bat.
[   +1 ms] [android\] C:\Program Files\Android\Android Studio\gradle\gradle-3.3\bin\gradle.bat app:properties
[+1263 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\gradle\gradle-3.3\bin\gradle.bat app:properties
[  +14 ms] E:\Android\sdk\build-tools\25.0.2\aapt dump badging build\app/outputs/apk/app.apk
[  +18 ms] Exit code 0 from: E:\Android\sdk\build-tools\25.0.2\aapt dump badging build\app/outputs/apk/app.apk
[        ] package: name='com.yourcompany.HotReloadBugTest' versionCode='1' versionName='0.0.1' platformBuildVersionName='7.1.1'
           sdkVersion:'16'
           targetSdkVersion:'21'
           uses-permission: name='android.permission.INTERNET'
           application-icon-160:'res/mipmap-mdpi-v4/ic_launcher.png'
           application-icon-240:'res/mipmap-hdpi-v4/ic_launcher.png'
           application-icon-320:'res/mipmap-xhdpi-v4/ic_launcher.png'
           application-icon-480:'res/mipmap-xxhdpi-v4/ic_launcher.png'
           application-icon-640:'res/mipmap-xxxhdpi-v4/ic_launcher.png'
           application: label='' icon='res/mipmap-mdpi-v4/ic_launcher.png'
           application-debuggable
           launchable-activity: name='com.yourcompany.HotReloadBugTest.MainActivity'  label='' icon=''
           feature-group: label=''
             uses-feature: name='android.hardware.faketouch'
             uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'
           main
           supports-screens: 'small' 'normal' 'large' 'xlarge'
           supports-any-density: 'true'
           locales:
           densities: '160' '240' '320' '480' '640'
           native-code: 'armeabi-v7a' 'x86' 'x86_64'
[ +429 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 logcat -v time -t 1
[  +75 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 logcat -v time -t 1
[        ] --------- beginning of main
           04-22 14:17:10.536 E/Accel   (  828): AccelerationSensor: unknown event (type=2, code=7)
[   +5 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 logcat -v time
[   +2 ms] E:\Android\sdk\platform-tools\adb version
[  +10 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb version
[        ] Android Debug Bridge version 1.0.39
           Revision 5943271ace17-android
[   +3 ms] E:\Android\sdk\platform-tools\adb start-server
[  +12 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb start-server
[        ] Building APK
[  +20 ms] Using gradle from C:\Program Files\Android\Android Studio\gradle\gradle-3.3\bin\gradle.bat.
[   +2 ms] Running 'gradle assembleDebug'...
[   +1 ms] [android\] C:\Program Files\Android\Android Studio\gradle\gradle-3.3\bin\gradle.bat -Ptarget=E:\Flutter\HotReloadBugTest\lib/main.dart assembleDebug
[+1315 ms] The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
[   +1 ms]      at build_8zmbh5u1xup9qf2dtx4d0g1yt$_run_closure2.doCall(E:\Flutter\HotReloadBugTest\android\build.gradle:20)
[   +1 ms] Incremental java compilation is an incubating feature.
[   +6 ms] The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
[   +1 ms]      at build_8zmbh5u1xup9qf2dtx4d0g1yt$_run_closure2.doCall(E:\Flutter\HotReloadBugTest\android\build.gradle:20)
[  +79 ms] :app:flutterBuildX86Jar UP-TO-DATE
[        ] :app:preBuild UP-TO-DATE
[        ] :app:preDebugBuild UP-TO-DATE
[   +1 ms] :app:checkDebugManifest
[        ] :app:prepareDebugDependencies
[   +1 ms] :app:compileDebugAidl UP-TO-DATE
[   +1 ms] :app:compileDebugRenderscript UP-TO-DATE
[   +3 ms] :app:generateDebugBuildConfig UP-TO-DATE
[+5831 ms] :app:flutterBuildDebug
[   +3 ms] :app:mergeDebugShaders UP-TO-DATE
[   +1 ms] :app:compileDebugShaders UP-TO-DATE
[        ] :app:generateDebugAssets UP-TO-DATE
[   +2 ms] :app:mergeDebugAssets UP-TO-DATE
[  +16 ms] :app:copyFlutterAssetsDebug
[   +1 ms] :app:generateDebugResValues UP-TO-DATE
[        ] :app:generateDebugResources UP-TO-DATE
[   +4 ms] :app:mergeDebugResources UP-TO-DATE
[   +3 ms] :app:processDebugManifest UP-TO-DATE
[   +4 ms] :app:processDebugResources UP-TO-DATE
[        ] :app:generateDebugSources UP-TO-DATE
[   +4 ms] :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
[   +6 ms] :app:compileDebugJavaWithJavac UP-TO-DATE
[   +3 ms] :app:compileDebugNdk UP-TO-DATE
[   +2 ms] :app:compileDebugSources UP-TO-DATE
[   +1 ms] :app:transformClassesWithDexForDebug UP-TO-DATE
[   +1 ms] :app:mergeDebugJniLibFolders UP-TO-DATE
[   +2 ms] :app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
[   +1 ms] :app:processDebugJavaRes UP-TO-DATE
[   +3 ms] :app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
[   +1 ms] :app:validateSigningDebug
[+1016 ms] :app:packageDebug
[   +1 ms] :app:assembleDebug
[   +1 ms] BUILD SUCCESSFUL
[        ] Total time: 8.266 secs
[ +368 ms] calculateSha: build\app/outputs/apk/app.apk
[ +289 ms] Built build\app/outputs/apk/app-debug.apk (21.9MB).
[        ] E:\Android\sdk\build-tools\25.0.2\aapt dump badging build\app/outputs/apk/app.apk
[   +6 ms] Exit code 0 from: E:\Android\sdk\build-tools\25.0.2\aapt dump badging build\app/outputs/apk/app.apk
[        ] package: name='com.yourcompany.HotReloadBugTest' versionCode='1' versionName='0.0.1' platformBuildVersionName='7.1.1'
           sdkVersion:'16'
           targetSdkVersion:'21'
           uses-permission: name='android.permission.INTERNET'
           application-icon-160:'res/mipmap-mdpi-v4/ic_launcher.png'
           application-icon-240:'res/mipmap-hdpi-v4/ic_launcher.png'
           application-icon-320:'res/mipmap-xhdpi-v4/ic_launcher.png'
           application-icon-480:'res/mipmap-xxhdpi-v4/ic_launcher.png'
           application-icon-640:'res/mipmap-xxxhdpi-v4/ic_launcher.png'
           application: label='' icon='res/mipmap-mdpi-v4/ic_launcher.png'
           application-debuggable
           launchable-activity: name='com.yourcompany.HotReloadBugTest.MainActivity'  label='' icon=''
           feature-group: label=''
             uses-feature: name='android.hardware.faketouch'
             uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps'
           main
           supports-screens: 'small' 'normal' 'large' 'xlarge'
           supports-any-density: 'true'
           locales:
           densities: '160' '240' '320' '480' '640'
           native-code: 'armeabi-v7a' 'x86' 'x86_64'
[   +3 ms] Stopping app 'app.apk' on mediatek mt6795.
[        ] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 shell am force-stop com.yourcompany.HotReloadBugTest
[ +574 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 shell pm list packages com.yourcompany.HotReloadBugTest
[ +547 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 shell pm list packages com.yourcompany.HotReloadBugTest
[   +1 ms] package:com.yourcompany.HotReloadBugTest
[   +4 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 shell cat /data/local/tmp/sky.com.yourcompany.HotReloadBugTest.sha1
[  +42 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 shell cat /data/local/tmp/sky.com.yourcompany.HotReloadBugTest.sha1
[   +1 ms] eba5988537aad60097aded2182d833c0579ec9dd
[   +2 ms] Installing APK.
[   +1 ms] E:\Android\sdk\platform-tools\adb version
[  +16 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb version
[        ] Android Debug Bridge version 1.0.39
           Revision 5943271ace17-android
[   +1 ms] E:\Android\sdk\platform-tools\adb start-server
[  +17 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb start-server
[        ] Installing build\app/outputs/apk/app.apk...
[   +2 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 install -r build\app/outputs/apk/app.apk
[+5586 ms] [  0%] /data/local/tmp/app.apk
                   [  0%] /data/local/tmp/app.apk
                   [  1%] /data/local/tmp/app.apk
                   [  1%] /data/local/tmp/app.apk
                   ... (nothing special here)
                   [100%] /data/local/tmp/app.apk
                   build\app/outputs/apk/app.apk: 1 file pushed. 6.5 MB/s (22952830 bytes in 3.380s)
                        pkg: /data/local/tmp/app.apk
                   Success
[   +8 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 shell echo -n 4d204be13c6c8b6ccf49cd9a7b4d6049b931f146 > /data/local/tmp/sky.com.yourcompany.HotReloadBugTest.sha1
[  +24 ms] mediatek mt6795 startApp
[   +1 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez enable-checked-mode true com.yourcompany.HotReloadBugTest/com.yourcompany.HotReloadBugTest.MainActivity
[ +592 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez enable-checked-mode true com.yourcompany.HotReloadBugTest/com.yourcompany.HotReloadBugTest.MainActivity
[   +1 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.yourcompany.HotReloadBugTest/.MainActivity (has extras) }
[   +2 ms] Waiting for observatory port to be available...
[ +572 ms] Diagnostic server Uri on device: http://127.0.0.1:38169/
[   +9 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 forward tcp:8101 tcp:38169
[  +20 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 forward tcp:8101 tcp:38169
[        ] Forwarded host port 8101 to device port 38169 for Diagnostic server
[   +1 ms] Observatory Uri on device: http://127.0.0.1:37602/
[   +1 ms] E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 forward tcp:8100 tcp:37602
[  +14 ms] Exit code 0 from: E:\Android\sdk\platform-tools\adb -s 9SYTGAZP99999999 forward tcp:8100 tcp:37602
[        ] Forwarded host port 8100 to device port 37602 for Observatory
[  +21 ms] Connected to service protocol: http://127.0.0.1:8100/
[+1313 ms] DevFS: Creating new filesystem on the device (null)
[  +66 ms] DevFS: Created new filesystem on the device (file:///data/user/0/com.yourcompany.HotReloadBugTest/cache/HotReloadBugTestvIfCnY/HotReloadBugTest/)
[   +3 ms] Updating assets
[ +120 ms] Syncing files to device...
[   +2 ms] DevFS: Starting sync from LocalDirectory: 'E:\Flutter\HotReloadBugTest'
[        ] Scanning project files
[   +4 ms] Scanning package files
[  +50 ms] Scanning asset files
[        ] Scanning for deleted files
[  +18 ms] Updating files
[+3949 ms] DevFS: Sync finished
[        ] Synced 5.8MB.
[  +15 ms] Connected to _flutterView/0xe9f5de60.
[        ] 🔥  To hot reload your app on the fly, press "r". To restart the app entirely, press "R".
[        ] The Observatory debugger and profiler is available at: http://127.0.0.1:8100/
[        ] For a more detailed help message, press "h". To quit, press "q".
[+3546 ms] Initializing hot reload...
[   +2 ms] Refreshing active FlutterViews before reloading.
[ +223 ms] Syncing files to device...
[        ] DevFS: Starting sync from LocalDirectory: 'E:\Flutter\HotReloadBugTest'
[        ] Scanning project files
[        ] Scanning package files
[  +15 ms] Scanning asset files
[        ] Scanning for deleted files
[  +14 ms] DevFS: Sync finished
[        ] Synced 0.0MB.
[+1533 ms] Service protocol connection closed.
[   +2 ms] Lost connection to device.
[   +4 ms] DevFS: Deleting filesystem on the device (file:///data/user/0/com.yourcompany.HotReloadBugTest/cache/HotReloadBugTestvIfCnY/HotReloadBugTest/)
[ +252 ms] TimeoutException after 0:00:00.250000: Future not completed
[   +2 ms] 'flutter run' took 30503ms.
[ +128 ms] ensureAnalyticsSent: 124ms
[   +2 ms] exiting with code 0

Flutter Doctor

[√] Flutter (on Microsoft Windows [Version 10.0.15063], channel master)
    • Flutter at E:\Flutter\flutter
    • Framework revision ad496e142b (4 hours ago), 2017-04-22 10:27:03 +0200
    • Engine revision a5b64899c9
    • Tools Dart version 1.23.0-dev.11.11

[√] Host Executable Compatibility
    • Downloaded executables execute on host

[√] Android toolchain - develop for Android devices (Android SDK 25.0.2)
    • Android SDK at E:\Android\sdk
    • Platform android-25, build-tools 25.0.2
    • ANDROID_HOME = E:\Android
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version: OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[√] Android Studio (version 2.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Gradle version 3.3
    • Java version: OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[√] IntelliJ IDEA Community Edition (version 2017.1)
    • Dart plugin version 171.4249.16
    • Flutter plugin version 13.0

[√] Connected devices
    • mediatek mt6795 • 9SYTGAZP99999999 • android-arm • Android 6.0.1 (API 23)
@abarth
Copy link
Contributor

abarth commented Apr 22, 2017

@johnmccutchan @goderbauer

@abarth abarth added this to the 2: Make Early Adopters happy milestone Apr 22, 2017
@abarth abarth added c: regression It was better in the past than it is now platform-windows Building on or for Windows specifically labels Apr 22, 2017
@johnmccutchan
Copy link
Contributor

The "Lost connection to device." message indicates that the engine/shell has crashed. No error messages though? @goderbauer can you reproduce on a Windows machine?

@susch19
Copy link
Author

susch19 commented Apr 24, 2017

Sadly i got no error message and that made it quite hard to track down the "exact" issue. Something to note here the examples are working.

@goderbauer
Copy link
Member

I am currently unable to reproduce this on my Windows machine. According to flutter doctor the only difference between my setup and @susch19's setup is that I am still running Windows 10.0.14393 and that I am deploying to a different device:

• Nexus 6P • 84B5T15A10012703 • android-arm • Android 7.1.1 (API 25)

Other than that, our environments are identical.

@goderbauer
Copy link
Member

@susch19 What do you mean by "the examples are working"? Do you only see this error with one specific flutter project? Or with all flutter projects on your machine?

@susch19
Copy link
Author

susch19 commented Apr 24, 2017

@goderbauer All projects, except the examples included in flutter. As i written in the first post, even a new project has the same bug.

@goderbauer
Copy link
Member

@susch19 Can you run flutter run --bug-report and perform the actions that lead to the crash? This should create a zip file with the bug report that you can send to me for further investigation.

@susch19
Copy link
Author

susch19 commented Apr 24, 2017

Should i just attach it to a comment or how would you like to get the file?

@goderbauer
Copy link
Member

That would be fine.

@susch19
Copy link
Author

susch19 commented Apr 24, 2017

It's bigger than 10mb, so i uploaded it to gdrive

@goderbauer
Copy link
Member

I think I figured it out:

This is a problem with the case-insensitivity of file names on Windows and them being case sensitive on Android. In other words, Windows doesn't care if a file is names Test.dart or test.dart. For Windows (and Dart on Windows), it's the same. However, when we copy the file over to Android, it is important that we distinguish between the two. For Android (and Dart on Android) Test.dart and test.dart are not the same! I'll work on fixing this in our code. Until that's available, there is a work-around:

Work-around: You should follow dart convention (see [1]) and name your dart packages as well as all dart files using lowercase_with_underscores style (see [1] for examples of that style in the Dart style guide). For your example, that means HotReloadBugTest should be renamed to hot_reload_bug_test, Test.dart should be renamed to test.dart and you should import it with import 'package:hot_reload_bug_test/test.dart'. If you follow this convention of naming your packages using the lowercase_with_underscores style, hot reload should work as expected.

[1] https://www.dartlang.org/guides/language/effective-dart/style#do-name-libraries-and-source-files-using-lowercasewithunderscores

@susch19
Copy link
Author

susch19 commented Apr 24, 2017

@goderbauer Thank you, this has worked

@johnmccutchan johnmccutchan changed the title Reload not working on Windows since #9424 Code that works on case-insensitive file systems can/will fail on case-sensitive filesystems Apr 24, 2017
@johnmccutchan
Copy link
Contributor

I've updated the title of this bug to better reflect what we've discovered.

@goderbauer
Copy link
Member

Fixed with #9571.

@github-actions
Copy link

github-actions bot commented 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 -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now platform-windows Building on or for Windows specifically
Projects
None yet
Development

No branches or pull requests

4 participants