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

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.

Related

Unable to access flutter doctor from my flutter console [duplicate]

When I run in terminal flutter pub get is stuck it's showing
OS MacOS Catalina 10.15.3
Got TLS error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Got socket error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
Got TLS error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 3 in 4 seconds...
Got socket error trying to find package launch_review at https://pub.dartlang.org.
pub get failed (server unavailable) -- attempting retry 4 in 8 seconds...
Got socket error trying to find package launch_review at https://pub.dartlang.org.
Quick fixes before explanation:
Restart your router! Works for me several times.
Make sure your network is not behind a proxy
Make sure you can ping to pub.dev without any packet loss
Try to close all of your dart.exe processes before retying to perform the flutter pub get
Try to delete an existing package from your pubspec.yaml and re-get it to see if it works
Try to manually add the package to your project
So, I had (and sometime still having) the same issue. I've analyzed it and came to a conclusion that the package download manager and the server that hosts those packages aren't reliabe at all. Very small packages might just successfully be imported with "flutter pub get", whereas big ones might last forever to download. This is definately a networking issue, on either yours or their side.
Just for verificatioin that we are indeed experiencing the same issue:
open your cmd (no matter t OS) and run: ping -t pub.dev .Now, if you see those inconsitent replies from the server, it means there's something wrong with the network (yours or their side). This looks something like this:
Open up your task manager and look for the latest dart.exe task (it should be invoked the moment you flutter pub get. This task is the package that is being downloaded. If you see the process size never exceeding a certain size, and the get command is still stuck, it only indicates a network issue and the package might never be downloaded successfully. For example, my attempts to get the carousela_flutter 1.4.1 package ended up with a halted process size of around 60mb, looks this this:
If you wait for a relatively large amount of time (10 minutes I would say is enough) and the connectivity issue is still not resolved, you will see the following msg from flutter:
"Process finished with exit code 0".
I suggest you try another time or maually add the package.
p.s: it doesn't happen with all of the packages and from my investigation is seems to be related to the size of it. e.g, I managed to get the carousela_flutter 0.7.0 package, but the 1.4.1 failed.
In my case, The host of my ISP was blocked so it could not get the package and it was showing pub get failed (server unavailable) -- attempting retry 1 in 1 second...
So I turn on my VPN and tried once again and this time it was a success
If its a git error, use this command:
git config --global url."https://".insteadOf git://
More info here
502 Bad Gateway trying to find package package_name at https://pub.dartlang.org.
If you click on the link, you'll find that the website is down. The same is also applied to https://pub.dev/.
I´ve solved it on my Windows machine.
After many tries from answers in many discussions out there, I tried a lot of stuff, like:
Restarting the machine
Deleting the cache folder (the dart-sdk download may be restarted)
Adding dart-sdk in the Environment Variable Path
X:\Dev\Flutter\bin\cache\dart-sdk\
Adding dart-sdk´s bin folder in the Path variable (for both Environment and User Variables) (desperate action, I know)
X:\Dev\Flutter\bin\cache\dart-sdk\bin
And still didn´t work.
BUT... I´ve found on this thread something about a proxy problem.
Then I´ve decided to try it out on my Windows machine, and it worked (finally).
Try typing this on Power Shell:
$Env:https_proxy="your.proxy.here:8080"
Then try flutter doctor again
hmm, i know how frustrating it can be trying to solve the issue, the best solution to this is to use vpn and connect to another server. this way i was able to solve the problem without stress
As said it might be something that has to do with your network....
Disconnecting and reconnecting fixed mine.
Make sure no firewall is blocking it.
Check for Internet connectivity too. Search your browser, don't rely on the windows wifi symbol.
For me, KIS (Kaspersky) was blocking pub.bat.
If that is the case please also check---- Flutter, dart, android studio, Gradlew.bat, sdkmanager.bat, adb.exe, qemu-systems, emulator-check and google for any blockage. (just search in firewall settings).
In my case it was my virus program (AVG AntiVirus' Web Shield) that suddenly caused pub get to fail.
Because restaurant depends on flutter any from sdk which doesn't exist (unknown SDK "flutter"), version solving failed
fix proplem
done
change this package
this path prev last
path_provider_windows:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/lib/
change path fluatter plus /all
path
path_provider_windows:file:///C:/all/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/lib/
its ok
thanks
I was able to resolve it by using Visual Studio Debuggable Package Manager PowerShell, on your system open visual studio debuggable package manager and then type in flutter doctor it will resolve it within seconds
make sure there is no typo in pubpspec.yaml check it on here https://stackoverflow.com/a/72198419/8122500

Flutter - Pub failed to rename directory because access was denied

I have installed flutter 2 on my machine, and since this morning I have been receiving this error, when I try to give flutter pub get, in my terminal, or simply flutter doctor. I found several solutions on the internet but I don't know what it can be, and none of them solved my problem. I saw it on one of the sites that may be conflicting with antivirus, but I installed my new one yesterday, and it started to give error only today.
flutter doctor
Pub failed to rename directory because access was denied.
This may be caused by a virus scanner or having a file
in the directory open in another application.
Running "flutter pub get" in flutter_tools...
pub get failed (1; in the directory open in another application.)
There were GitHub issues that was filed before relating to this. There were no proper solutions to this, instead you can try some solutions that was mentioned in the following issue tickets:
https://github.com/dart-lang/pub/issues/1798
https://github.com/flutter/flutter/issues/16100
You can try one of the solution mentioned in this GitHub thread:
Try to run flutter pub cache repair.
There is another ticket that is still open for the troubleshooting to be added in the Flutter documentation for reference of everyone. And to be considered as the universal solution for this problem.

Getting cmd: Failure calling service activity: Failed transaction (2147483646) when trying to debug on emulator

Started getting this error all of a sudden for my Flutter project
Clearing cache did not help.
Rebooting did not help
What fixed it for me is closing the emulator and cold-booting it.
I was having the same issue. Here's what worked for me:
Navigate to AVD folders in file explorer (for me it was ursnm/.android./avd)
Select and delete all files in here,
From Android Studio, go to AVD Manager (should be empty now) and create a new device.
I am very novice, so I have no idea why this worked, but it did for me.
-Brian

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

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

Flutter error: Unable to locate gradlew script

I can't run all of my flutter apps, because in the console appears everytime this error message:
Downloading Gradle Wrapper... 1,2s
Launching lib\main.dart on SM G960F in debug mode...
Running Gradle task 'assembleDebug'...
Finished with error: Unable to locate gradlew script. Please check that C:\Users\...\android\gradlew.bat exists or that C:\Users\...\android can be read.
I try to fix this problem more than ten hours and don't find a solution.
I will advise you to check your pc properly for unwanted programs. Something is preventing your pc from running the Gradle. I had the same issue only to realize that antivirus was installed on my pc alongside a cd burner that I just installed. Check for any antivirus that might be preventing Gradle from running.
I also faced the same error initially. While creating a flutter application from scratch I just ran the default flutter application which is a counter app in a flutter. I faced the same issue at first. If you are in this same context as described earlier the following could be the solution
1.Java 8 is more suitable for the flutter/android development. The next versions of java have some exceptions. I used the Java 14 and stuck at this issue for some time
The next could be the JAVA_HOME path in your environment variables. If it is not provided the set the JAVA_HOME path.
Run flutter --doctor and check the requirements if satisfied like Android SDK is updated or not, upgrade flutter if required. In some cases having good Internet connection also plays a role in this issue some times.
These are the major points to be satisfied in order to get rid of this error. Mostly this could be the a solution or part of it.
The error suggests that something is preventing gradle to run properly on your machine. Check whether you have any unwanted programs or anti-virus on your machine running that might be preventing gradle to run. If so, remove or stop those programs / anti-virus and try again.
After that, delete the .gradle folder located here C:\Users\yourPcName\.gradle containing the unfinished file and try again . It will work now .
You can also manually download Gradle and map it in Android studio , Learn more with this article here .
Warning, the gradle versions change quickly, so make sure you manually
downloaded the exact version that flutter wanted to download and the
download failed. Download the gradle here and then replace it in the
gradle folder.
C:\Users\yourPcName\.gradle\wrapper\dists\gradle-x.x.x-all
If it still doesn't work,
Try to run flutter --doctor
From a console window that has the Flutter directory in the path (see above), run the following command to see if there are any platform dependencies you need to complete the setup:
C:\src\flutter> : flutter doctor
This command checks your environment and displays a report of the status of your Flutter installation. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).
You can learn more here :
If flutter doctor itself doesn't work, then know that flutter is not installed on your machine (or you forgot to add it to the environment
variable).
I also faced this problem and I made something to run my app on android
tried to open anything on android files and android studio ask me if I want to open for editing android file in android studio then click on it and it will open android project then click run enter image description here