title: Dart Analysis server terminated and lost connection to the device
body: <p>i face two problem:</p>
  
  <blockquote>
    <p>Dart Analyzer server has terminated</p>
    
    <p>lost connection to the device</p>
  </blockquote>
  
  <p>i also raised the issue on flutter, dart repo but don't get any response, i am not able to work on any project. i also did  clean windows installation two time but still the same problem, i check all the available solution here on stackoverflow also all the issue on flutter and dart github repo, please someone help me to solve this problem.</p>
  
  <p>flutter doctor -v result:</p>
  
  <pre><code>[√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18363.418], locale en-US)
      • Flutter version 1.12.13+hotfix.5 at C:\src\flutter
      • Framework revision 27321ebbad (11 days ago), 2019-12-10 18:15:01 -0800
      • Engine revision 2994f7e1e6
      • Dart version 2.7.0
  
  [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
      • Android SDK at C:\Users\Akash\AppData\Local\Android\sdk
      • Android NDK location not configured (optional; useful for native profiling support)
      • Platform android-29, build-tools 29.0.2
      • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
      • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
      • All Android licenses accepted.
  
  [√] Android Studio (version 3.5)
      • Android Studio at C:\Program Files\Android\Android Studio
      • Flutter plugin version 42.1.1
      • Dart plugin version 191.8593
      • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
  
  [√] VS Code (version 1.41.1)
      • VS Code at C:\Users\Akash\AppData\Local\Programs\Microsoft VS Code
      • Flutter extension version 3.7.1
  
  [√] Connected device (1 available)
      • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
  
  • No issues found!
  exit code 0
  </code></pre>
  
  <p>Log files:</p>
  
  <pre><code>Dart Code extension: 3.7.1
  Flutter extension: 3.7.1 (not activated)
  VS Code: 1.41.1
  Platform: win
  HTTP_PROXY: undefined
  NO_PROXY: undefined
  
  Sun Dec 22 2019 [14:21:51 GMT+0530 (India Standard Time)] Log file started
  [2:21:51 PM] [General] [Info] Searching for SDKs...
  [2:21:51 PM] [General] [Info] Environment PATH:
  [2:21:51 PM] [General] [Info]     C:\Windows\system32
  [2:21:51 PM] [General] [Info]     C:\Windows
  [2:21:51 PM] [General] [Info]     C:\Windows\System32\Wbem
  [2:21:51 PM] [General] [Info]     C:\Windows\System32\WindowsPowerShell\v1.0\
  [2:21:51 PM] [General] [Info]     C:\Windows\System32\OpenSSH\
  [2:21:51 PM] [General] [Info]     C:\Program Files\Git\cmd
  [2:21:51 PM] [General] [Info]     C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
  [2:21:51 PM] [General] [Info]     C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
  [2:21:51 PM] [General] [Info]     C:\src\flutter\bin
  [2:21:51 PM] [General] [Info]     C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\Scripts\
  [2:21:51 PM] [General] [Info]     C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\
  [2:21:51 PM] [General] [Info]     C:\Users\Akash\AppData\Local\Microsoft\WindowsApps
  [2:21:51 PM] [General] [Info]     C:\Users\Akash\AppData\Local\Programs\Microsoft VS Code\bin
  [2:21:51 PM] [General] [Info]     C:\src\flutter\bin
  [2:21:51 PM] [General] [Info] Found Flutter project at C:\Users\Akash\Desktop\hwvs\hello_world:
              Mobile? true
              Web? false
              Create Trigger? false
              Flutter Repo? false
  [2:21:51 PM] [General] [Info] Searching for flutter.bat
  [2:21:51 PM] [General] [Info]     Looking for flutter.bat in:
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\Desktop\hwvs\hello_world
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\Desktop\hwvs\hello_world\bin
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\Desktop\hwvs\hello_world\.flutter
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\Desktop\hwvs\hello_world\.flutter\bin
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\Desktop\hwvs\hello_world\vendor\flutter
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\Desktop\hwvs\hello_world\vendor\flutter\bin
  [2:21:51 PM] [General] [Info]         C:\Windows\system32
  [2:21:51 PM] [General] [Info]         C:\Windows\system32\bin
  [2:21:51 PM] [General] [Info]         C:\Windows
  [2:21:51 PM] [General] [Info]         C:\Windows\bin
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\Wbem
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\Wbem\bin
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\bin
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\OpenSSH\
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\OpenSSH\bin
  [2:21:51 PM] [General] [Info]         C:\Program Files\Git\cmd
  [2:21:51 PM] [General] [Info]         C:\Program Files\Git\cmd\bin
  [2:21:51 PM] [General] [Info]         C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
  [2:21:51 PM] [General] [Info]         C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR\bin
  [2:21:51 PM] [General] [Info]         C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
  [2:21:51 PM] [General] [Info]         C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\bin
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\Scripts\
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\Scripts\bin
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\bin
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Microsoft\WindowsApps
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Microsoft\WindowsApps\bin
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Microsoft VS Code\bin
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin
  [2:21:51 PM] [General] [Info]     Found at:
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin
  [2:21:51 PM] [General] [Info]     Candidate paths to be post-filtered:
  [2:21:51 PM] [General] [Info]         C:\src\flutter
  [2:21:51 PM] [General] [Info]         C:\src\flutter
  [2:21:51 PM] [General] [Info]         C:\src\flutter
  [2:21:51 PM] [General] [Info]     Found at C:\src\flutter
  [2:21:51 PM] [General] [Info]     Returning SDK path C:\src\flutter for flutter.bat
  [2:21:51 PM] [General] [Info] Searching for dart.exe
  [2:21:51 PM] [General] [Info]     Looking for dart.exe in:
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\cache\dart-sdk
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\cache\dart-sdk\bin
  [2:21:51 PM] [General] [Info]         C:\Windows\system32
  [2:21:51 PM] [General] [Info]         C:\Windows\system32\bin
  [2:21:51 PM] [General] [Info]         C:\Windows
  [2:21:51 PM] [General] [Info]         C:\Windows\bin
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\Wbem
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\Wbem\bin
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\bin
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\OpenSSH\
  [2:21:51 PM] [General] [Info]         C:\Windows\System32\OpenSSH\bin
  [2:21:51 PM] [General] [Info]         C:\Program Files\Git\cmd
  [2:21:51 PM] [General] [Info]         C:\Program Files\Git\cmd\bin
  [2:21:51 PM] [General] [Info]         C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
  [2:21:51 PM] [General] [Info]         C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR\bin
  [2:21:51 PM] [General] [Info]         C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
  [2:21:51 PM] [General] [Info]         C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\bin
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\Scripts\
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\Scripts\bin
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Python\Python38-32\bin
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Microsoft\WindowsApps
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Microsoft\WindowsApps\bin
  [2:21:51 PM] [General] [Info]         C:\Users\Akash\AppData\Local\Programs\Microsoft VS Code\bin
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\cache\dart-sdk
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\cache\dart-sdk\bin
  [2:21:51 PM] [General] [Info]     Found at:
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\cache\dart-sdk\bin
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\cache\dart-sdk\bin
  [2:21:51 PM] [General] [Info]     Candidate paths to be post-filtered:
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\cache\dart-sdk
  [2:21:51 PM] [General] [Info]         C:\src\flutter\bin\cache\dart-sdk
  [2:21:51 PM] [General] [Info]     Found at C:\src\flutter\bin\cache\dart-sdk
  [2:21:51 PM] [General] [Info]     Returning SDK path C:\src\flutter\bin\cache\dart-sdk for dart.exe
  [2:21:51 PM] [General] [Info] Activating Flutter extension for Flutter project...
  [2:21:51 PM] [General] [Info] Extension:Startup timing: 77ms
  [2:21:52 PM] [General] [Info] Analyzer:Startup timing: 433ms
  [2:21:55 PM] [General] [Info] Analyzer:FirstAnalysis timing: 2240ms
  [2:21:57 PM] [General] [Info] Checking 1 projects for supported platforms
  [2:21:57 PM] [General] [Info] Supported platforms for the workspace are ios, android
  [2:24:39 PM] [General] [Info] Starting debug session...
  [2:24:39 PM] [General] [Info]     workspace: C:\Users\Akash\Desktop\hwvs\hello_world
  [2:24:39 PM] [General] [Info] Using found common entry point: C:\Users\Akash\Desktop\hwvs\hello_world\lib\main.dart
  [2:24:39 PM] [General] [Info] Using workspace as cwd: C:\Users\Akash\Desktop\hwvs\hello_world
  [2:24:39 PM] [General] [Info] Detected launch project as Flutter
  [2:24:39 PM] [General] [Info] Using Flutter debug adapter for this session
  [2:24:39 PM] [General] [Info] Checking for errors before launching
  [2:24:39 PM] [General] [Info] Spawning a new flutter debugger
  [2:24:39 PM] [General] [Info] Debug session starting...
      {
          "noDebug": true,
          "program": "C:\\Users\\Akash\\Desktop\\hwvs\\hello_world\\lib\\main.dart",
          "cwd": "C:\\Users\\Akash\\Desktop\\hwvs\\hello_world",
          "name": "Dart &amp; Flutter",
          "type": "dart",
          "request": "launch",
          "args": [],
          "vmAdditionalArgs": [],
          "vmServicePort": 0,
          "dartPath": "C:\\src\\flutter\\bin\\cache\\dart-sdk\\bin\\dart.exe",
          "maxLogLineLength": 2000,
          "pubPath": "C:\\src\\flutter\\bin\\cache\\dart-sdk\\bin\\pub.bat",
          "pubSnapshotPath": "C:\\src\\flutter\\bin\\cache\\dart-sdk\\bin\\snapshots\\pub.dart.snapshot",
          "debugSdkLibraries": false,
          "debugExternalLibraries": false,
          "showDartDeveloperLogs": true,
          "useFlutterStructuredErrors": true,
          "debuggerHandlesPathsEverywhereForBreakpoints": true,
          "evaluateGettersInDebugViews": true,
          "previewDebuggerStepBack": false,
          "forceFlutterVerboseMode": false,
          "flutterTrackWidgetCreation": true,
          "flutterMode": "debug",
          "flutterPlatform": "default",
          "flutterPath": "C:\\src\\flutter\\bin\\flutter.bat",
          "deviceId": "emulator-5554",
          "deviceName": "Pixel 3a API 29 (android-x86)",
          "showMemoryUsage": false,
          "debugServer": 55153,
          "debuggerType": 2
      }
  [2:24:39 PM] [General] [Warn] Did not find session c1e7e06d-fbe6-48be-9a1c-b461e7b8c7e6 to handle dart.launching. There were 0 sessions:
  [2:24:39 PM] [General] [Warn] Event will be queued and processed when the session start event fires
  [2:24:39 PM] [General] [Info] Processing delayed event dart.launching for session c1e7e06d-fbe6-48be-9a1c-b461e7b8c7e6
  [2:25:27 PM] [General] [Info] Debugger:SessionDuration timing: 47627ms (Flutter)
  [2:25:40 PM] [General] [Error] Cannot call write after a stream was destroyed
  Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
      at doWrite (_stream_writable.js:413:19)
      at writeOrBuffer (_stream_writable.js:401:5)
      at Socket.Writable.write (_stream_writable.js:301:11)
      at m.sendMessage (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:45556)
      at m.sendMessage (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:39197)
      at c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:45364
      at new Promise (&lt;anonymous&gt;)
      at m.sendRequest (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:45176)
      at m.editGetFixes (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:290549)
      at t.FixCodeActionProvider.&lt;anonymous&gt; (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:436166)
      at Generator.next (&lt;anonymous&gt;)
      at c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:435700
      at new Promise (&lt;anonymous&gt;)
      at r (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:435445)
      at t.FixCodeActionProvider.provideCodeActions (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:436006)
      at c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:441239
      at Array.map (&lt;anonymous&gt;)
      at t.RankingCodeActionProvider.&lt;anonymous&gt; (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:441230)
      at Generator.next (&lt;anonymous&gt;)
      at c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:440679
      at new Promise (&lt;anonymous&gt;)
      at r (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:440424)
      at t.RankingCodeActionProvider.provideCodeActions (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\…
  [2:25:40 PM] [General] [Error] Cannot call write after a stream was destroyed
  Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
      at doWrite (_stream_writable.js:413:19)
      at writeOrBuffer (_stream_writable.js:401:5)
      at Socket.Writable.write (_stream_writable.js:301:11)
      at m.sendMessage (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:45556)
      at m.sendMessage (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:39197)
      at c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:45364
      at new Promise (&lt;anonymous&gt;)
      at m.sendRequest (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:45176)
      at m.editGetAssists (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:290272)
      at t.AssistCodeActionProvider.&lt;anonymous&gt; (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:397337)
      at Generator.next (&lt;anonymous&gt;)
      at c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:396876
      at new Promise (&lt;anonymous&gt;)
      at r (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:396621)
      at t.AssistCodeActionProvider.provideCodeActions (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:397178)
      at c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:441239
      at Array.map (&lt;anonymous&gt;)
      at t.RankingCodeActionProvider.&lt;anonymous&gt; (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:441230)
      at Generator.next (&lt;anonymous&gt;)
      at c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:440679
      at new Promise (&lt;anonymous&gt;)
      at r (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\out\dist\extension.js:1:440424)
      at t.RankingCodeActionProvider.provideCodeActions (c:\Users\Akash\.vscode\extensions\dart-code.dart-code-3.7.1\o…
  </code></pre>