0

Dart analysis often freeze on android studio. So, quick doc and code completion didn't work.

I have tried to restart android studio, delete file on folder .dartServer, downgrade dart plugin and flutter plugin version, downgrade flutter sdk, disable un-used plugins, increase memory of android studio, and reinstall android studio. In vscode, dart analysis often freeze too.

My laptop storage is ssd, still has empty space 110 gb, and ram 16 gb.

Size of lib folder on project : 215 KB (613 KB on disk).

Please, can anybody tell me the solution?

i p
  • 24
  • 4
  • have you tried it with other projects or used flutter clean? – larsaars Dec 22 '20 at 00:59
  • yes, i did. In new project, there is no problem.But, I think this problem appear, because the files is bigger – i p Dec 22 '20 at 04:06
  • and did you maybe try to create a new project and only transfer your code? then you would see if that is really the problem or if it is a misconfigured project etc. – larsaars Dec 22 '20 at 11:13
  • Yes, I've tried it, and the problem still appear – i p Dec 22 '20 at 12:28
  • this helped me, [Enable Scope Analysis to the Current Package](https://stackoverflow.com/a/71223418/13521429) – Shubham Sep 18 '22 at 09:26

1 Answers1

0

Have a look at the following link

as suggested try to enable dart.previewLsp

In VSCode settings, go to settings search for "dart preview lsp", select the checkbox under Dart: Preview Lsp and restart.

enter image description here

Unfortunately, Dart preview LSP is not supported for android studio yet.

Cedar
  • 303
  • 1
  • 13
  • I just followed the link. Does dart.previewLsp settings only available in vscode? how about in android studio? – i p Dec 22 '20 at 04:47
  • I mean, how to settings dart.previewLsp in android studio? – i p Dec 22 '20 at 10:19
  • 1
    Android studio is not yet supported, check the following link: https://microsoft.github.io/language-server-protocol/implementors/tools/ , for supported editors. – Cedar Dec 22 '20 at 10:43