Skip to content

Need to restart or flutter clean too often #16604

Closed

Description

@dedeswim



The following note was added by @tvolkert on Oct 16, 2018

If you are affected by this bug,

please fill out the following form!

https://goo.gl/forms/eFPT6A3jAD8clU4o2 (Survey to gather information about this bug)




Steps to Reproduce

When I (or one of my teammates) run flutter flutter run (or with the run/debug button on IntelliJ and VSCode) on an AVD or on real devices, the installed version is always behind the newest one and I always need to restart the app or even sometimes flutter clean.
This is a problem especially when the build on the AVD/real device crashes, and the only solution here is to flutter clean, even when I stop the app running and do flutter run again.

The same happens when building and installing production APKs:
When I run flutter build and flutter install, the installed APK isn't updated.
If I run flutter clean, and next, again, flutter build and flutter install, the installed APK is up-to-date.

Flutter Doctor:

[√] Flutter (Channel beta, v0.2.8, on Microsoft Windows [Versione 10.0.17133.73], locale it-IT)
    • Flutter version 0.2.8 at C:\Users\Edoardo Debenedetti\flutter
    • Framework revision b397406561 (13 days ago), 2018-04-02 13:53:20 -0700
    • Engine revision c903c217a1
    • Dart version 2.0.0-dev.43.0.flutter-52afcba357

[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at C:\Users\Edoardo Debenedetti\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • 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
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[√] IntelliJ IDEA Ultimate Edition (version 2018.1)
    • IntelliJ at C:\Users\Edoardo Debenedetti\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\181.4203.550
    • Flutter plugin version 23.1.3
    • Dart plugin version 181.4203.498

[√] VS Code, 64-bit edition (version 1.22.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Dart Code extension version 2.11.2

[√] Connected devices (2 available)
    • PRA LX1                   • 57UDU17111026756 • android-arm64 • Android 7.0 (API 24)
    • Android SDK built for x86 • emulator-5554    • android-x86   • Android 8.1.0 (API 27) (emulator)

• No issues found!

Activity

  1. changed the title [-]Need to `restart` or `flutter clean` too often[/-] [+]Need to restart or flutter clean too often[/+] on Apr 15, 2018
  2. ratsey commented on Apr 28, 2018

    @ratsey

    Not alone in this - incredibly frustrating to have to 'flutter clean' with seemingly every code change before the changes are reflected in Android Studio debug.

    [√] Flutter (Channel master, v0.3.6-pre.43, on Microsoft Windows [Version 10.0.16299.371], locale en-US)
        • Flutter version 0.3.6-pre.43 at E:\flutter
        • Framework revision 32d1f0a80a (17 hours ago), 2018-04-27 13:34:50 -0700
        • Engine revision e11905c6e5
        • Dart version 2.0.0-dev.50.0.flutter-8d4074175f
    
    [√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
        • Android SDK at C:\Users\jens\AppData\Local\Android\sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-27, build-tools 27.0.3
        • Java binary at: E:\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 E:\Program Files\Android\Android Studio
        • Flutter plugin version 24.0.1
        • Dart plugin version 173.4700
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    
    [√] IntelliJ IDEA Community Edition (version 2018.1)
        • IntelliJ at E:\Program Files\JetBrains\IntelliJ IDEA Community Edition 181.4203.6
        • Flutter plugin version 22.2.3
        • Dart plugin version 181.4096.12
    
    [√] VS Code, 64-bit edition (version 1.22.2)
        • VS Code at C:\Program Files\Microsoft VS Code
        • Dart Code extension version 2.11.2
    
    [√] Connected devices (1 available)
        • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
    
    • No issues found!
    
  3. escamoteur commented on May 4, 2018

    @escamoteur
    Contributor

    I encounter the same problem at the moment, how reload shows the latest changes but if I restart cold I get an old version only flutter clean helps.

  4. iampawan commented on May 4, 2018

    @iampawan

    +1 Same problem here and in fact for me flutter clean also doesn't help sometimes & I have to delete the app manually and then rebuild it. It is really annoying and frustrating.. :(

  5. KgotsoK commented on May 4, 2018

    @KgotsoK

    Also have been experiencing the same with Flutter.

    UNRELATED: Funny thing is that I also had a similar issue with pure Android development. Android's Instant Run also left me with an older version once I restart the app after debugging.

  6. iampawan commented on May 4, 2018

    @iampawan

    @sethladd can you please help with this on priority basis ? It's like the major pro became the major con :(

  7. escamoteur commented on May 4, 2018

    @escamoteur
    Contributor

    Totally agree. This is a major regression. Not long ago I wrote in a blog post how happy I was that Flutter tooling just worked compared to Xamarin but now it's almost worse. Hot reload too often doesn't work on current dev and Master branches

  8. ratsey commented on May 4, 2018

    @ratsey

    So frustrating. The Android Studio Debug button will typically not respect recent changes in the code, necessitating a flutter clean before running. Hot reload from Android Studio just doesn't work. If I run a terminal 'flutter run' the hot reload seems to work just fine, but of course I get no debugging tools.

    What is run by a 'flutter run' command is clearly not the same code as is run using the Android Studio icons. It's to the point to debug I have to flutter clean every run which is horrific when trying to resolve issues.

    UPDATE: The issue appears to be limited to debugging. Using Android Studio's 'run' icon is as fast as from the terminal and respects recent code changes. For some reason, attempting to debug always requires a flutter clean operation to respect recent code changes.

    [√] Flutter (Channel master, v0.3.6-pre.43, on Microsoft Windows [Version 10.0.16299.371], locale en-US)
        • Flutter version 0.3.6-pre.43 at E:\flutter
        • Framework revision 32d1f0a80a (7 days ago), 2018-04-27 13:34:50 -0700
        • Engine revision e11905c6e5
        • Dart version 2.0.0-dev.50.0.flutter-8d4074175f
    
    [√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
        • Android SDK at C:\Users\jens\AppData\Local\Android\sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-27, build-tools 27.0.3
        • Java binary at: E:\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 E:\Program Files\Android\Android Studio
        • Flutter plugin version 24.0.1
        • Dart plugin version 173.4700
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    
    [√] IntelliJ IDEA Community Edition (version 2018.1)
        • IntelliJ at E:\Program Files\JetBrains\IntelliJ IDEA Community Edition 181.4203.6
        • Flutter plugin version 22.2.3
        • Dart plugin version 181.4096.12
    
    [√] VS Code, 64-bit edition (version 1.22.2)
        • VS Code at C:\Program Files\Microsoft VS Code
        • Dart Code extension version 2.11.2
    
    [√] Connected devices (1 available)
        • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
    
    • No issues found!
    
    
  9. added
    c: regressionIt was better in the past than it is now
    p: toolingAffects the flutter_plugin_tools package
    on May 4, 2018
  10. eseidelGoogle commented on May 4, 2018

    @eseidelGoogle
    Contributor

    @cbracken @tvolkert sounds like a bad regression. Any ideas?

  11. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    p: toolingAffects the flutter_plugin_tools package
    on May 4, 2018
  12. tvolkert commented on May 4, 2018

    @tvolkert
    Contributor

    @cbracken any chance this could be related to your work on fingerprinting and simplifying build code paths?

  13. escamoteur commented on May 4, 2018

    @escamoteur
    Contributor

    Could it be a Windows problem? I'm on Windows too. Most devs seems to work on a Mac, so this might be a reason why this hasn't come up earlier? Just a guess

  14. 223 remaining items

  15. filiph commented on Mar 25, 2020

    @filiph
    Contributor

    Should we close this? For what it's worth, I am not seeing the issue anymore. And I see that at least one underlying bug was fixed recently.

    It's also possible we might want to split this into several issues, and use this one as a tracking meta-issue.

  16. Reprevise commented on Mar 25, 2020

    @Reprevise

    I haven't had this issue in awhile, I'm on the latest beta 1.15.17.

  17. zanderso commented on Mar 25, 2020

    @zanderso
    Member

    I suspect that we'll find more focused issues to be more useful/actionable. @jonahwilliams wdyt?

  18. ride4sun commented on Mar 25, 2020

    @ride4sun

    I don't see the issue anymore. I am on channel beta.

  19. starlight173 commented on Mar 26, 2020

    @starlight173

    The issue seems gone away in stable channel (1.12.13 hotfix 8)

  20. cmaccarone commented on Mar 31, 2020

    @cmaccarone

    I have version 1.12.13 hotfix 8 and I seem to be having this problem still. I ran

    flutter clean

    and it seemed to fix the issue temporarily at least

  21. dev-paulperez commented on Apr 5, 2020

    @dev-paulperez

    In my case, this situation occured after updating flutter and editing external library. I solved this issue by doing

    flutter clean
    

    and then by running

    flutter pub cache repair
    

    and then re-build your app.

    This fix the problem for me!! (Update Dart and Flutter too).

  22. antheus-s commented on Apr 7, 2020

    @antheus-s

    I have followed the "flutter pub cache repair" solution but now my hot reload doesn't work anymore and I need to flutter clean for every build. Any other suggestions?

  23. eseidelGoogle commented on Apr 7, 2020

    @eseidelGoogle
    Contributor

    @antheuss that sounds like it might be a separate issue, which I'm very interested in understanding. Would you be willing to file a new issue with your specific concerns so we can help you get them resolved? Thanks!

  24. ngominhtrungit commented on Apr 10, 2020

    @ngominhtrungit

    The following note was added by @tvolkert on Oct 16, 2018

    If you are affected by this bug,

    please fill out the following form!

    https://goo.gl/forms/eFPT6A3jAD8clU4o2 (Survey to gather information about this bug)

    Steps to Reproduce

    When I (or one of my teammates) run flutter flutter run (or with the run/debug button on IntelliJ and VSCode) on an AVD or on real devices, the installed version is always behind the newest one and I always need to restart the app or even sometimes flutter clean.
    This is a problem especially when the build on the AVD/real device crashes, and the only solution here is to flutter clean, even when I stop the app running and do flutter run again.

    The same happens when building and installing production APKs:
    When I run flutter build and flutter install, the installed APK isn't updated.
    If I run flutter clean, and next, again, flutter build and flutter install, the installed APK is up-to-date.

    Flutter Doctor:

    [√] Flutter (Channel beta, v0.2.8, on Microsoft Windows [Versione 10.0.17133.73], locale it-IT)
        • Flutter version 0.2.8 at C:\Users\Edoardo Debenedetti\flutter
        • Framework revision b397406561 (13 days ago), 2018-04-02 13:53:20 -0700
        • Engine revision c903c217a1
        • Dart version 2.0.0-dev.43.0.flutter-52afcba357
    
    [√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
        • Android SDK at C:\Users\Edoardo Debenedetti\AppData\Local\Android\sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-27, build-tools 27.0.3
        • 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
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    
    [√] IntelliJ IDEA Ultimate Edition (version 2018.1)
        • IntelliJ at C:\Users\Edoardo Debenedetti\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\181.4203.550
        • Flutter plugin version 23.1.3
        • Dart plugin version 181.4203.498
    
    [√] VS Code, 64-bit edition (version 1.22.2)
        • VS Code at C:\Program Files\Microsoft VS Code
        • Dart Code extension version 2.11.2
    
    [√] Connected devices (2 available)
        • PRA LX1                   • 57UDU17111026756 • android-arm64 • Android 7.0 (API 24)
        • Android SDK built for x86 • emulator-5554    • android-x86   • Android 8.1.0 (API 27) (emulator)
    
    • No issues found!
    

    Ghi chú sau đã được @tvolkert thêm vào ngày 16 tháng 10 năm 2018

    Nếu bạn bị ảnh hưởng bởi lỗi này,

    Hãy điền vào mẫu dưới đây!

    https://goo.gl/forms/eFPT6A3jAD8clU4o2 (Khảo sát để thu thập thông tin về lỗi này)

    Các bước để sinh sản

    Khi tôi (hoặc một trong những đồng đội của tôi) chạy rung flutter run(hoặc bằng nút chạy / gỡ lỗi trên IntelliJ và VSCode) trên AVD hoặc trên các thiết bị thực, phiên bản đã cài đặt luôn ở phía sau phiên bản mới nhất và tôi luôn cần khởi động lại ứng dụng hoặc thậm chí đôi khi flutter clean.
    Đây là một vấn đề đặc biệt là khi quá trình xây dựng trên AVD / thiết bị thực gặp sự cố và giải pháp duy nhất ở đây là flutter clean, ngay cả khi tôi dừng ứng dụng chạy và làm flutter runlại.

    Điều tương tự cũng xảy ra khi xây dựng và cài đặt APK sản xuất:
    Khi tôi chạy flutter buildvà flutter install, APK đã cài đặt không được cập nhật.
    Nếu tôi chạy rung sạch, và tiếp theo, một lần nữa, flutter buildvà flutter installAPK đã cài đặt sẽ được cập nhật.

    Bác sĩ rung rinh:

    [√] Flutter (Channel beta, v0.2.8, on Microsoft Windows [Versione 10.0.17133.73], locale it-IT)
        • Flutter version 0.2.8 at C:\Users\Edoardo Debenedetti\flutter
        • Framework revision b397406561 (13 days ago), 2018-04-02 13:53:20 -0700
        • Engine revision c903c217a1
        • Dart version 2.0.0-dev.43.0.flutter-52afcba357
    
    [√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
        • Android SDK at C:\Users\Edoardo Debenedetti\AppData\Local\Android\sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-27, build-tools 27.0.3
        • 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
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    
    [√] IntelliJ IDEA Ultimate Edition (version 2018.1)
        • IntelliJ at C:\Users\Edoardo Debenedetti\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\181.4203.550
        • Flutter plugin version 23.1.3
        • Dart plugin version 181.4203.498
    
    [√] VS Code, 64-bit edition (version 1.22.2)
        • VS Code at C:\Program Files\Microsoft VS Code
        • Dart Code extension version 2.11.2
    
    [√] Connected devices (2 available)
        • PRA LX1                   • 57UDU17111026756 • android-arm64 • Android 7.0 (API 24)
        • Android SDK built for x86 • emulator-5554    • android-x86   • Android 8.1.0 (API 27) (emulator)
    
    • No issues found!
    

    Thanks a lot, I fixed it.

  25. boucoding commented on Apr 12, 2020

    @boucoding

    same issue on the last version on stable channel

  26. antheus-s commented on Apr 13, 2020

    @antheus-s

    @antheuss that sounds like it might be a separate issue, which I'm very interested in understanding. Would you be willing to file a new issue with your specific concerns so we can help you get them resolved? Thanks!

    I actually fixed it by reïnstalling my complete development environment after executing the commands described earlier. Thank you very much though. :-)

  27. zanderso commented on Apr 13, 2020

    @zanderso
    Member

    This issue has gotten a bit long and overloaded. @jonahwilliams work in this area should have addressed the bulk of the problems. If folks still have issues that are fixed by a flutter clean, please file a new issue with full details. Thanks!

  28. locked as resolved and limited conversation to collaborators on Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: annoyanceRepeatedly frustrating issues with non-experimental functionalityc: regressionIt was better in the past than it is nowcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.t: gradle"flutter build" and "flutter run" on Androidt: hot reloadReloading code during "flutter run"t: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions