Flutter randomly crashes and removes flutter files

1,292

Solution 1

I've found the problem. Apparently my laptop doesn't like it when i run flutter clean. So as long as i don't use that command my flutter won't crash...

Solution 2

Do you have any cloud file sync application running ? e.g. MS OneDrive or Google Backup & sync. At times, these application have exclusive access to these files which hampers other operations e.g. folder deletion (and perhaps crashing Android Studio). Suggestion - Pausing for some time( or killing them) is worth trying.

Solution 3

  • I would suggest you use the Microsoft Visual Code for development.
  • Use command line "flutter build apk" to build
  • make sure you have enough hard disk space and memory space
  • what does flutter doctor -v
Share:
1,292
Vincent van Ruijven
Author by

Vincent van Ruijven

Updated on December 07, 2022

Comments

  • Vincent van Ruijven
    Vincent van Ruijven over 1 year

    I'm currently using Android Studio 3.2 to develop a flutter application using flutter 0.9.4 beta version on my Windows 10 laptop. But sinds yesterday Android studio ranomly crashes (screen gets black and stops most of my applications like android studio, sourcetree, whatsapp, etc). But Android studio nor Flutter show an actual error, everything just stops working.

    When I try to reopen Android Studio after the crash i'm unable to run my flutter application (Android studio wont see any connected devices or emulators, only does that in a flutter application, native android application works fine). Also the flutter command stops working, it's not getting recognized by Windows anymore.

    To solve this i have to reinstall my flutter (also runned flutter doctor, but it says my flutter is correctly installed) and replace the platform-tools folder with the newest because the crash makes this part unuseable. After i've done all that i can run my application again.

    The thing is after about 30-45 minutes the crash happens again and I can start all over again.

    What I have tried to resolve this issue:

    • Reinstall Android Studio
    • Reinstalled Android SDK's
    • Reinstall Flutter
    • Downgraded Android studio
    • Downgraded flutter
    • Removed all emulators
    • Rebooted laptop several times
    • closed all other applications
    • checked if I have corrupt memory
    • excluded the flutter and android studio directories from my virusscanner(G Data Security)
    • Runned flutter as Admin
    • Changed flutter channel to master and back to dev

    At this point i'm really out of options to solve my problem and would like some help to solve this issue.

    EDIT: Also at the time of the crash both my CPU and RAM aren't using 100% of their capacity