Dart Analysis server has terminated
Asked Answered
P

7

8

I develop in Flutter for 1 year and suddenly I faced this error after launching IntelliJ IDEA. The Dart analysis has stopped to work. And only way to analyze code is via dart analyze lib/ that is so inconvenient.

Is there anyone who know what's causing this?

Dart analysis issue

Stack Overflow

Version information

  • Dart SDK 2.10.2
  • Dart IntelliJ 202.7319.5
  • IntelliJ IDEA 2020.2.3
  • Mac OS X 10.15.7

Details

Stack Overflow

#0      Driver._captureExceptions.errorFunction (package:analysis_server/src/server/driver.dart:732:7)
#1      _CustomZone.handleUncaughtError (dart:async/zone.dart:1076:19)
#2      _CustomZone.runGuarded (dart:async/zone.dart:999:7)
#3      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#4      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#5      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#6      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:125:20)
#7      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
#8      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:125:20)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
#10     _CustomZone.runGuarded (dart:async/zone.dart:1093:19)
#11     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#12     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#13     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#14     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:125:20)
#15     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
#16     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#17     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#18     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#19     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#20     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#21     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#22     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#23     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#24     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#25     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#26     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#27     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#28     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#29     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#30     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#31     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#32     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#33     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
...
...
#4959   _File._fileForRelativeUri (package:analyzer/src/services/available_declarations.dart:1738:20)
#4960   _File.refresh (package:analyzer/src/services/available_declarations.dart:1213:19)
#4961   DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#4962   _File._fileForRelativeUri (package:analyzer/src/services/available_declarations.dart:1738:20)
#4963   _File.refresh (package:analyzer/src/services/available_declarations.dart:1213:19)
#4964   DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#4965   _File._fileForRelativeUri (package:analyzer/src/services/available_declarations.dart:1738:20)
#4966   _File.refresh (package:analyzer/src/services/available_declarations.dart:1213:19)
#4967   DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#4968   _File._fileForRelativeUri (package:analyzer/src/services/available_declarations.dart:1738:20)
#4969   _File.refresh (package:analyzer/src/services/available_declarations.dart:1213:19)
#4970   DeclarationsTracker._getFileByPath (package:analyzer/src/services/available_declarations.dart:699:14)
#4971   DeclarationsTracker.doWork (package:analyzer/src/services/available_declarations.dart:601:18)
#4972   CompletionLibrariesWorker.performWork (package:analysis_server/src/domains/completion/available_suggestions.dart:302:13)
#4973   AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:1939:35)
#4974   _rootRunUnary (dart:async/zone.dart:1198:47)
#4975   _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#4976   _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#4977   Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#4978   Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#4979   Future._completeWithValue (dart:async/future_impl.dart:529:5)
#4980   _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#4981   _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#4982   Monitor.signal (package:analyzer/src/dart/analysis/status.dart)
#4983   _rootRunUnary (dart:async/zone.dart:1198:47)
#4984   _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#4985   _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#4986   Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#4987   Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#4988   Future._addListener.<anonymous closure> (dart:async/future_impl.dart:393:9)
#4989   _rootRun (dart:async/zone.dart:1190:13)
#4990   _CustomZone.runGuarded (dart:async/zone.dart:1093:19)
#4991   _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#4992   _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#4993   _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#4994   _Timer._runTimers (dart:isolate-patch/timer_impl.dart:125:20)
#4995   _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

And:

Dart analysis issue

Stack Overflow

Version information

  • Dart SDK 2.10.2
  • Dart IntelliJ 202.7319.5
  • IntelliJ IDEA 2020.2.3
  • Mac OS X 10.15.7

Details

Stack Overflow

#0      Driver._captureExceptions.errorFunction (package:analysis_server/src/server/driver.dart:732:7)
#1      _CustomZone.handleUncaughtError (dart:async/zone.dart:1076:19)
#2      _CustomZone.runGuarded (dart:async/zone.dart:999:7)
#3      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#4      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#5      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#6      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:125:20)
#7      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
#8      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
#9      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:125:20)
#10     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
#11     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
#12     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#13     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#14     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#15     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#16     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:125:20)
#17     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
#18     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
#19     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#20     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#21     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#22     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#23     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#24     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#25     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#26     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#27     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#28     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#29     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#30     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#31     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#32     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#33     _File.refresh (package:analyzer/src/services/available_declarations.dart:1738:20)
#34     DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
...
...
#4965   DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#4966   _File._fileForRelativeUri (package:analyzer/src/services/available_declarations.dart:1738:20)
#4967   _File.refresh (package:analyzer/src/services/available_declarations.dart:1213:19)
#4968   DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#4969   _File._fileForRelativeUri (package:analyzer/src/services/available_declarations.dart:1738:20)
#4970   _File.refresh (package:analyzer/src/services/available_declarations.dart:1213:19)
#4971   DeclarationsTracker._getFileByUri (package:analyzer/src/services/available_declarations.dart:713:14)
#4972   _File._fileForRelativeUri (package:analyzer/src/services/available_declarations.dart:1738:20)
#4973   _File.refresh (package:analyzer/src/services/available_declarations.dart:1213:19)
#4974   DeclarationsTracker._getFileByPath (package:analyzer/src/services/available_declarations.dart:699:14)
#4975   DeclarationsTracker.doWork (package:analyzer/src/services/available_declarations.dart:601:18)
#4976   CompletionLibrariesWorker.performWork (package:analysis_server/src/domains/completion/available_suggestions.dart:302:13)
#4977   AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:1939:35)
#4978   _rootRunUnary (dart:async/zone.dart:1198:47)
#4979   _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#4980   _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#4981   Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#4982   Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#4983   Future._completeWithValue (dart:async/future_impl.dart:529:5)
#4984   _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#4985   _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#4986   Monitor.signal (package:analyzer/src/dart/analysis/status.dart)
#4987   _rootRunUnary (dart:async/zone.dart:1198:47)
#4988   _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#4989   _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#4990   Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#4991   Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#4992   Future._addListener.<anonymous closure> (dart:async/future_impl.dart:393:9)
#4993   _rootRun (dart:async/zone.dart:1190:13)
#4994   _CustomZone.run (dart:async/zone.dart:1093:19)
#4995   _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#4996   _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#4997   _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#4998   _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#4999   _Timer._runTimers (dart:isolate-patch/timer_impl.dart:125:20)
#5000   _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
#5001   _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Picturize answered 23/10, 2020 at 12:37 Comment(2)
please report a complete stack trace to github.com/dart-lang/sdk/issuesClubfoot
I have already done it. github.com/dart-lang/sdk/issues/43899 There was an issue with Dart Analyzer Server.Jeremy
P
17

This helped me.

Deleting ~/.dartServer/.analysis-driver/ might be worth a try.

From: Alt+Enter stopped working for Dart files in IntelliJ

It is caused by Stack overflow in Dart Analyzer Server.

Picturize answered 23/10, 2020 at 14:23 Comment(1)
It also helps when running into "Dart analysis issue: Bad state: Suspected cycle..."Harebell
C
3

I ran into a similar issue where the analysis server won't start in Android Studio.

Deleting flutter/bin/cache helped.

https://github.com/flutter/flutter/issues/41552#issuecomment-566074395

Callow answered 13/3, 2023 at 2:13 Comment(0)
D
2

Deleting flutter/bin/cache then force upgrade Flutter.

flutter upgrade --force

This will repaire the cached flutter where Dart SDK is also found.

Dorolice answered 9/7, 2023 at 22:58 Comment(0)
M
1

I found an easy way to fix this error, you first run "flutter upgrade" so you have to re-install all by "flutter upgrade --force". This can help you guys

Mechanist answered 19/6, 2023 at 3:40 Comment(0)
A
0

Delete flutter/bin/cache and then flutter upgrade or flutter upgrade --force run command this is work for me

Adventurism answered 4/8, 2023 at 7:4 Comment(0)
I
0

This happened to me because I deleted my "analysis_server.dart.snapshot" file from the ~/flutter/bin/cache/dart-sdk/bin/snapshots. By running the flutter upgrade or flutter upgrade --force resolved the problem.

Illustrious answered 28/10, 2023 at 8:53 Comment(0)
F
0

It’s related to the Dart SDK. Delete the

flutter/bin/cache

folder, then use the command dart --version in zsh to reinstall the correct Dart SDK. Afterward, open your project and run flutter pub get to complete the setup.

Flux answered 3/9, 2024 at 15:53 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.