mar
mar

Reputation: 21

Could not find Dart in your Flutter SDK. Please run 'flutter doctor' in the terminal then reload the project once all issues are resolved

I am getting this error after starting a project in visual studio code. It show up in every project.

error

I did an update before. There are no updates available now. I also update Xcode.

These are the logs of the error:

> [10:26:29 AM] [General] [Info] Searching for SDKs... [10:26:29 AM]
> [General] [Info] Environment PATH: [10:26:29 AM] [General] [Info]    
> /usr/local/bin [10:26:29 AM] [General] [Info]     /usr/bin [10:26:29
> AM] [General] [Info]     /bin [10:26:29 AM] [General] [Info]    
> /usr/sbin [10:26:29 AM] [General] [Info]     /sbin [10:26:29 AM]
> [General] [Info]     /Library/Apple/usr/bin [10:26:29 AM] [General]
> [Info]     /Users/marcin/Development/flutter/bin [10:26:29 AM]
> [General] [Info]     /Users/marcin/Development/flutter/.pub-cache/bin
> [10:26:29 AM] [General] [Info]    
> /Users/marcin/Development/flutter/bin/cache/dart-sdk/bin [10:26:29 AM]
> [General] [Info] Found Flutter project at
> /Users/marcin/Documents/Apps/najlepsza_silownia_w_miescie:            Mobile?
> true          Web? false          Create Trigger? false           Flutter Repo? false
> [10:26:29 AM] [General] [Info] Searching for flutter [10:26:29 AM]
> [General] [Info]     Looking for flutter in: [10:26:29 AM] [General]
> [Info]        
> /Users/marcin/Documents/Apps/najlepsza_silownia_w_miescie [10:26:29
> AM] [General] [Info]        
> /Users/marcin/Documents/Apps/najlepsza_silownia_w_miescie/bin
> [10:26:29 AM] [General] [Info]        
> /Users/marcin/Documents/Apps/najlepsza_silownia_w_miescie/.flutter
> [10:26:29 AM] [General] [Info]        
> /Users/marcin/Documents/Apps/najlepsza_silownia_w_miescie/.flutter/bin
> [10:26:29 AM] [General] [Info]        
> /Users/marcin/Documents/Apps/najlepsza_silownia_w_miescie/vendor/flutter
> [10:26:29 AM] [General] [Info]        
> /Users/marcin/Documents/Apps/najlepsza_silownia_w_miescie/vendor/flutter/bin
> [10:26:29 AM] [General] [Info]         /Users/marcin/flutter-sdk
> [10:26:29 AM] [General] [Info]         /Users/marcin/flutter-sdk/bin
> [10:26:29 AM] [General] [Info]         /google/flutter [10:26:29 AM]
> [General] [Info]         /google/flutter/bin [10:26:29 AM] [General]
> [Info]         /usr/local/bin [10:26:29 AM] [General] [Info]        
> /usr/bin [10:26:29 AM] [General] [Info]         /bin [10:26:29 AM]
> [General] [Info]         /usr/sbin [10:26:29 AM] [General] [Info]     
> /sbin [10:26:29 AM] [General] [Info]         /Library/Apple/usr/bin
> [10:26:29 AM] [General] [Info]        
> /Users/marcin/Development/flutter/bin [10:26:29 AM] [General] [Info]  
> /Users/marcin/Development/flutter/.pub-cache/bin [10:26:29 AM]
> [General] [Info]        
> /Users/marcin/Development/flutter/bin/cache/dart-sdk/bin [10:26:29 AM]
> [General] [Info]     Found at: [10:26:29 AM] [General] [Info]        
> /Users/marcin/Development/flutter/bin [10:26:29 AM] [General] [Info]  
> Candidate paths to be post-filtered: [10:26:29 AM] [General] [Info]   
> /Users/marcin/Development/flutter [10:26:29 AM] [General] [Info]    
> Found at /Users/marcin/Development/flutter [10:26:29 AM] [General]
> [Info]     Returning SDK path /Users/marcin/Development/flutter for
> flutter [10:26:29 AM] [General] [Info] Flutter is not initialized,
> running 'flutter doctor' to force... [10:26:29 AM] [General] [Info]
> (PROC 1570) Logging data for process... [10:26:29 AM] [General] [Info]
> (PROC 1570) Downloading Darwin arm64 Dart SDK from Flutter engine
> <<<<<<< HEAD ab46186b246f5a36bd1f3f295d14a43abb1e2f38
> ======= caaafc5604ee9172293eb84a381be6aadd660317
> >>>>>>> fb57da5f945d02ef4f98dfd9409a72b7cce74268... [10:26:29 AM] [General] [Info] (PROC 1570) curl: (3) URL using bad/illegal format or
> missing URL [10:26:29 AM] [General] [Info] (PROC 1570)
> /Users/marcin/Development/flutter/bin/internal/update_dart_sdk.sh:
> line 156: return: can only `return' from a function or sourced script
> [10:26:29 AM] [General] [Info] (PROC 1570) curl: (3) URL using
> bad/illegal format or missing URL [10:26:29 AM] [General] [Info] (PROC
> 1570)  Failed to retrieve the Dart SDK from:
> https://storage.googleapis.com/flutter_infra_release/flutter/<<<<<<<
> HEAD ab46186b246f5a36bd1f3f295d14a43abb1e2f38

Flutter doctor in Terminal shows that:

URL using bad/illegal format or missing URL

How can I solve this problem?

Upvotes: 1

Views: 1587

Answers (3)

Mohamad Fazel Hesari
Mohamad Fazel Hesari

Reputation: 116

it seems fixed with:

include config in ~/.bash_profile and run source ~/.bash_profile export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

close previous opened terminal and open a new one. run flutter upgrade --verbose --force

https://github.com/flutter/flutter/issues/54175

Upvotes: 0

mar
mar

Reputation: 21

I downloaded flutter again and swapped the folder, the problem is no longer there.

Upvotes: 1

Agrim Singh
Agrim Singh

Reputation: 519

Run flutter doctor and resolve all the errors if any.

Upvotes: 2

Related Questions