Home > Software engineering >  can`t debug Flutter project in VSCode (: Error: Not found: 'dart:ui')
can`t debug Flutter project in VSCode (: Error: Not found: 'dart:ui')

Time:10-21

I'm trying to learn Flutter and I have already set up the environment I'm using Andriod studio emulator and VSCode to run the Flutter file, and I'm using the default flutter project and it runs fine but when I run it with debug it doesn't work, and print : Error: Not found: 'dart:ui'

I tried looking for a solution but nothing worked


the full debug console output:

: Error: Not found: 'dart:ui'
../…/material/animated_icons.dart:10
import 'dart:ui' as ui show Paint, Path, Canvas;
       ^

: Error: Not found: 'dart:ui'
../…/material/animated_icons.dart:11
import 'dart:ui' show lerpDouble;
       ^
: Error: Not found: 'dart:ui'
../…/material/app.dart:5
import 'dart:ui' as ui;
       ^
: Error: Not found: 'dart:ui'
../…/material/app_bar_theme.dart:5
import 'dart:ui' show lerpDouble;
       ^

: Error: Not found: 'dart:ui'
../…/material/arc.dart:6
import 'dart:ui' show lerpDouble;
       ^

: Error: Not found: 'dart:ui'
../…/material/banner_theme.dart:5
import 'dart:ui' show lerpDouble;
       ^

: Error: Not found: 'dart:ui'
../…/material/bottom_app_bar_theme.dart:5
import 'dart:ui' show lerpDouble;
       ^
: Error: Not found: 'dart:ui'
../…/material/bottom_navigation_bar_theme.dart:5
import 'dart:ui' show lerpDouble;
       ^

: Error: Not found: 'dart:ui'
../…/material/bottom_sheet.dart:5
import 'dart:ui' show lerpDouble;
       ^

: Error: Not found: 'dart:ui'
../…/material/bottom_sheet_theme.dart:7
import 'dart:ui' show lerpDouble;
       ^

Exited (254)

flutter doctor result:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.19043.2006], locale ar-SA)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.5)
[√] Android Studio (version 2021.3)
[√] VS Code (version 1.72.1)
[√] VS Code, 64-bit edition
[√] Connected device (3 available)
[√] HTTP Host Availability

• No issues found!


Maybe I need to update android debug bridge?

thanks for helping

CodePudding user response:

I fixed the problem although I don't know what caused it but if I had to guess it is probably because I didn't install the android debug bridge properly

I did uninstall everything I downloaded Flutter Android studio the SDK's everything and reinstalled them again I was trying to avoid this but I didn't find any other way

if you have this problem I recommend you try to delete and install adb before deleting everything

  • Related