Search code examples
androidflutterdartflutter-packagesdart-analyzer

Target of URI doesn't exist in every flutter package even project folders


Today I upgraded the flutter to v 1.17.0 on stable channel when vs code was open and some tab where opened on vs code from my project. After flutter update finished, suddenly both vs code and Android Studio show error of "Target of URI doesn't exist:" in 70% of .dart file on my project even those are in main directory folder.

error in vs code

error in Android Studio

First I restarted the vs code (or Android Studio), but the same error appear. After that I try these commands but the error is still there:

flutter clean
flutter packages upgrade
flutter packages get

and here is the output of flutter doctor -vv:

[  +24 ms] executing: [D:\SourceFiles\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +61 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] e6b34c2b5c96bb95325269a29a84e83ed8909b5f
[        ] executing: [D:\SourceFiles\flutter/] git tag --contains HEAD
[ +269 ms] Exit code 0 from: git tag --contains HEAD
[   +1 ms] 1.17.0        
           1.17.0-3.4.pre
[  +10 ms] executing: [D:\SourceFiles\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +36 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [D:\SourceFiles\flutter/] git ls-remote --get-url origin
[  +34 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +91 ms] executing: [D:\SourceFiles\flutter/] git rev-parse --abbrev-ref HEAD
[  +38 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +1 ms] stable
[  +51 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[  +21 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +7 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[  +13 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +29 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[  +11 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +6 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[  +13 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[  +35 ms] executing: [D:\SourceFiles\flutter/] git rev-parse --abbrev-ref HEAD
[  +34 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[        ] Skipping request to fetchTags - on well known channel stable.
[        ] executing: [D:\SourceFiles\flutter/] git tag --contains HEAD
[ +308 ms] Exit code 0 from: git tag --contains HEAD
[   +1 ms] 1.17.0
           1.17.0-3.4.pre
[   +4 ms] Doctor summary (to see all details, run flutter doctor -v):
[  +18 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +121 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[        ] openjdk version "1.8.0_202-release"
           OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
           OpenJDK 64-Bit Server VM (build 25.202-b03, mixed mode)
[  +31 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[  +89 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[        ] openjdk version "1.8.0_202-release"
           OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
           OpenJDK 64-Bit Server VM (build 25.202-b03, mixed mode)
[   +9 ms] executing: [D:\SourceFiles\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%ar
[  +47 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%ar
[        ] 10 days ago
[  +51 ms] java -version
[ +146 ms] executing: D:\SourceFiles\sdk\platform-tools\adb.exe devices -l
[  +19 ms] [√] Flutter (Channel stable, v1.17.0, on Microsoft Windows [Version 10.0.18362.418], locale en-US)
\[  +73 ms] List of devices attached
[   +8 ms] executing: D:\SourceFiles\sdk\platform-tools\adb.exe devices -l
|[  +62 ms] List of devices attached
[ +155 ms] executing: D:\SourceFiles\sdk\tools\bin\sdkmanager --licenses

[+1872 ms] [!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[   +1 ms]     X Android license status unknown.
[   +1 ms]       Try re-installing or updating your Android SDK Manager.
[        ]       See https://developer.android.com/studio/#downloads or visit visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.
[  +24 ms] [√] Android Studio (version 3.5)
[   +5 ms] [√] VS Code, 32-bit edition
[   +4 ms] [√] VS Code, 64-bit edition (version 1.44.2)
[  +12 ms] [!] Connected device
[        ]     ! No devices available
[        ] ! Doctor found issues in 2 categories.
[   +9 ms] "flutter doctor" took 3,376ms.

Any idea?


Solution

  • After hours of searching and reinstalling IDEs, flutter and etc. I finally found when there is space in the uri(like space in folder name) the dart analyzer can't find it. In order to solve this, I changed all folder and remove space from the folder name. I think this is somehow an issue.