Florian
Florian

Reputation: 669

Dart Analyzer terminated on flutter clean or flutter run

Whenever I use the command flutter clean or flutter run, the window "The Dart Analyzer has terminated." pops up in VS Code. For flutter run I can specify that the analyzer terminates when it says "Running Gradle task 'assembleDebug'" in the console.

Here is the log after running flutter clean: https://hastebin.com/osovilenaj.swift

Can someone tell me the reason for this behaviour? I can simply click on restart, but it is annoying during my workflow.

Upvotes: 3

Views: 1356

Answers (3)

Aaydin
Aaydin

Reputation: 497

It concerns the Dart SDK. Remove the

flutter/bin/cache

directory and execute dart --version in zsh to download a properly functioning Dart SDK again. After that, open your project and run flutter pub get to finish.

Upvotes: 0

Florian
Florian

Reputation: 669

Since something (Dart?) has been updated the error does not occurre anymore.

Upvotes: 0

Akshit Ostwal
Akshit Ostwal

Reputation: 469

Try to update and restart both PC and VSCode, see if the problem persist.

It generally used to happen to me when either my CPU is doing too much work or the RAM is exhausted, see if you have same problem either with CPU or RAM use a real device to test with USB Debugging enabled instead of Emulator.

also this might also help VSCode dart analyzer stopped recognizing flutter/dart code

Upvotes: 0

Related Questions