I am not able to use flutter as im getting an error with the dart sdk, only it has been working for weeks until today - flutter

I am currently having this issue and can't find any solutions that work. Yesterday It was running fine and this afternoon when I wanted to code I received this message in the terminal.
flutter run... Downloading Dart SDK from Flutter engine <<<<<<< HEAD 07c1eed46b9d9b58df78566e9b8b2e42e80d3380
92ae191c17a53144bf4d62f3863c110be08e3fd3
8f89f6505b941329a864fef1527243a72800bf4d... curl: (3) URL using bad/illegal format or missing URL
Failed to retrieve the Dart SDK from: https://storage.googleapis.com/flutter_infra/flutter/<<<<<<< HEAD 07c1eed46b9d9b58df78566e9b8b2e42e80d3380
92ae191c17a53144bf4d62f3863c110be08e3fd3
8f89f6505b941329a864fef1527243a72800bf4d/dart-sdk-linux-x64.zip If you're located in China, please see this page: https://flutter.dev/community/china
I am not using a VPN, am not from china, and as I said this was running yesterday. I have tried reinstalling the flutter package, tried redirecting to redoing the path in Linux, also tried to just clone the github/flutter repo but nothing. Please help

Found that there was an issue with a file in
flutter/bin/internal called engine.version that had the same text as the "head" issue as mentioned in the error code. I have replaced the file with the one from the flutter GitHub repo and the error has gone. will close the issue.

Replace the /flutter/bin/internal/engine.version with the one from this https://github.com/flutter/flutter/blob/master/bin/internal/engine.version
and then run
flutter doctor

I had the same issue, tried everything I found on the internet but nothing worked... Finally, went to the folder where my flutter installation was, deleted the flutter folder, downloaded the flutter sdk again and named the unzipped folder exactly as the previous one: flutter.
This worked for me, so if all else fails, you can try this one.

I was getting that error too. Fixed by fixing the line-endings using the dos2unix utility:
Install dos2unix with sudo apt install dos2unix
Then run this in terminal:
dos2unix ~/snap/flutter/common/flutter/bin/internal/engine.version

Related

tried hot reload but the changes are not reflected on the emulator

So I pulled this code from my branch and made few changes using vs code and tried hot reload but the changes are not reflected on the emulator. This is a flutter app using dart. I noticed something that said 'source control - 3 unsaved changes'. Does that have to do anything with this?
1)Make sure you are having a stable internet connection, because sometimes the hot reload and code changes does not work when the internet connection is poor.
2)check the current versions of Flutter, IDE(VS code), Emulator. If you are not updated to the latest version that might be an issue because of the bugs, errors are not fixed in the older versions. command for upgrading the flutter is [flutter upgrade or flutter upgrade --force]
3)Finally in this case if the code is not properly formatted then you can't perform the hot reload function. try the flutter command to format code easily, From the terminal just run [flutter format lib] and it will format all the dart files in the lib directory and subdirectory. You can change lib with whatever directory you like.
4)on top of all still the issue is not resolved try to run command [dart fix --dry-run , dart fix --apply] visit the the official documentation of flutter and dart for more references.
5)I hope this will help you to sort out the issue, if not get back to us. Also replay back which method or solution helps you to solve the issue.

flutter application is not created even after the andrroid and flutter plugin installation setup

flutter application is not created even after the android and flutter plugin installation setup.
I have followed the following steps as given in the link
Flutter Installatioon steps
I dont know where I went wrong,. which installation steps I have missed.
My system is windows 32 bit.
I am encllosing the required screen shotsError screenshot
my system configuration
User Variable. path
Pleasee help me by fixing this issue
Try using Git instead of command line (cmd) and fix the path for flutter you should get the correct address for that for example: C:\flutter\bin

error flutter clean - windows-x64/font-subset tool download failed

I can't use anymore flutter clean or doctor in command line in Android Studio 3.6.1.
When I try I have this message :
Downloading windows-x64/font-subset tools...
Download failed.
URL: https://storage.googleapis.com/flutter_infra/flutter/e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/windows-x64/font-subset.zip
Error: 404 Not Found
I try to use gradlew clean. I had exactly the same message.
By the way flutter structure is empty when I open a flutter file and I don't have any completion or shortcut to go to functions (message: cannot find declaration to go to).
Do you have any clue to why it's happen and how to fix it?
Thanks
I found a solution.
I remove flutter.
I reinstall it and it's worked now.
If someone now why that's happen I am interested.
That's happened for some network issue, your network can not access the server.
More Details: https://github.com/flutter/flutter/issues/48030
Hope you will find your all answers and solutions.

Why does flutter packages get fail? Same directory cloned from github but on one pc package get fail

Cloned from github a flutter repo onto Laptop(win10) and Desktop (win7) but on Desktop package get fail with error code 1
First two images show success on laptop pc.
See Below Desktop Fails to get packages.
Where should I correct this on Desktop?
However, I can create new app without any error on Desktop.
Please help, Thank you.
I deleted the two log files and also pubspec.lock file and run Flutter Get Packages. This Resolved the issue. This agonizing error ate up few hours.
I tried
flutter clean
flutter packages get
it worked

How to fix 'No pubspec.yaml file found' when flutter project in OneDrive folder?

Run flutter packages get or flutter run in the root of my project, and it prompts the following
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.
exit code 1
This problem only appears in the project located under the OneDrive folder.
I can run flutter projects elsewhere.
I want to know if someone has the same problem.
After I reinstalled win10 today, this problem disappeared. So I guess this is my personal reason.
There is actually a GitHub issue filed related to your issue. And current status is still open. But there is a workaround to fix this.
The author have been able to resolve the error when the app was moved out from "OneDrive"
Yayy! It worked fine when I moved it out of OneDrive folder. So while
in OneDrive, it works fine until you touch pubspec.yaml. Anyways, all
good now!
There is a possibility that the team is still working on the issue.