I have installed the flutter folder in Program Files (x86) and have added the .../flutter/bin directory to path. Running flutter doctor in the flutter_console.bat window or just a normal command prompt window gives nothing
and running as admin in either gives me the error:
Updating flutter tool...
\flutter\.pub-cache was unexpected at this time.
What do I do? Thanks in advance for any help.
You shouldn't put Flutter in Program Files. These folders are not writeable by non-Admin users so may fail when trying to write files if you're not running your console/editor as Admin.
Cut flutter folder from Program Files (x86) to Program Files. It has problem with x86 but works fun in x64 directory. And update the environment variables with the new path.
I had mine fixed by just removing the special character from the directory name.
I organize my folders with numbering and parenthesis like so
1) xyz
2) yza
3) aws
...
25) flutter
I changed it to
1) xyz
2) yza
3) aws
...
25 flutter
don't forget to change it in environment variables too
Ok so this is probably not the way to go about it but what I did to solve this problem was remove this line
SET pub_cache_path=%FLUTTER_ROOT%\.pub-cache
from flutter/bin/flutter.bat. I then went through the installation process and once everything was working changed the flutter.bat file back by adding the line again and then ran flutter again. I got no errors from doing this and I appreciate that this is probably not the correct way to go about solving this problem but it worked for me so I am posting it as the answer if others want to try it.
1.Set the environment variable by copying the bin directory ex: C://programfiles/flutter/flutter/bin
2.Go to Control panel -> User Accounts -> User Accounts-> Change environment variables -> Choose User variable -> Path -> Edit -> New -> Paste the link -> click ok
3.Restart Computer -> Open powershell -> Type "Flutter"
4.It should be working now.
1- First make sure that you running cmd or powershell as admin.
2- If didn't work try to restart PC.
3- If didn't work try to move the flutter folder to another path and make sure that you did the required changes on Environment Variables.
4- If didn't work, just delete the cache folder in "flutter\bin" and try again by writing
flutter doctor
Also as a note, try not to put your flutter directory inside the special directories which need a special permissions like Program Files.
I had originally installed it in d:\Program Files (x86) which is NOT the system folder, but an alternate install location that does not require elevated privs, and I was getting this error. I moved flutter to just d:\flutter and it worked. I don't know if it was spaces or the parentheses that was problematic.
Extract the zip file and place the contained flutter in the desired installation location for the Flutter SDK (for example, C:\src\flutter; do not install Flutter in a directory like C:\Program Files\ that requires elevated privileges).
You are now ready to run Flutter commands in the Flutter Console!
Related
Running my application on another Windows machine results in a blank window. I works fine on the development machine.
I have included all the dll-files + data folder + 3 extra dll files mentioned on the Flutter website.
I have also ran "dependencies" on the resulting .exe file and can't see any missing dll's.
Compiling the "mydemo" application works fine, so I assume there are some other external files my application needs.
I have tried looking through the output of "flutter run -v" to find any clues of extra files needed, but can't see anything useful.
What is the preferred way to tackle a problem like this? How can I find out what files/resources are missing to distribute my app? Is there a way to use the "debug" version on the other machine instead and bring out the debug console window? I would guess that would show me errors when the app tries to load the missing resources.
Check if any package you depend on has some additional file requirements: for example, I'm using sqflite_common_ffi in some of my projects, which needs an additional DLL file to run. I don't know what you're referring to 'dependencies' ran on the EXE, though.
In any case, when I can't get any good output or error from a project, I do this: open up Windows prompt, go to the directory where you have put all the required files, and run
your_exe_file >> logFile.txt 2>&1
which will output the standard output and the standard error to the file. The log file name and extension don't really matter, it will be a simple text file.
For example, if I dont put the additional DLL for sqflite_common_ffi in the same folder of the compiled EXE, the output of the command above will specifically mention the name of the DLL that is missing.
if you got your project through a repository to run on another windows machine, use the command "flutter pub get"
I am trying to make pub an environment variable. The dart.dev says it must be in user/AppData/roaming folder named as pub I looked in roaming, local and locallow folders but there is not such a directory. The dart itself is installed with flutter sdk I looked in the folder too there is a folder named bup-cache but it does not have a pub.bat or pub.exe file as far as I saw.
Pub get itself works fine when i use it with flutter on VSC IDE but I can not locate the folder to make it environment variable.
Can you guys help me find The pub folder?
Thanks in advance
and be cool I'm a newbie
You have to go inside of this folder on Windows:
C:\Users\YOUR_USER_NAME\AppData\Local\Pub\Cache
Maybe you cleared the cache and that's why you cant find it
well i got it sorted out in a way the folder was not there and i needed it to use stagehand.
I simply ran a code in CMD or whatever shell which let to solution it was:
dart pub global activate stagehand
Whenever I try to run a dart tool like Dart Migrate I get the following error and I am unable to run that tool. Is there a way to solve this problem or I have to reinstall Flutter?
Btw every thing is okay with Flutter Doctor
After a lot of effort and wasting a lot of time on this issue I have been able to solve this problem. I have installed dart-sdk separately in the past and place the path of that dart-sdk at the top (before flutter one) in environment variables PATH. So I deleted that old dart-sdk path and deleted the respective folder this solved my problem.
In VS Code, if you get "Can't Load Kernel binary: Invalid SDK Hash" in Flutter or Dart, update dart.sdkPath setting
If you get this in VS Code, in addition to re-downloading the dart-sdk, make sure the "dart.sdkPath" setting in user/workspace settings is pointing to the new SDK. In my case, even though I had it in my path as in Junaid's answer, VS Code was still looking to the old dart-sdk folder and giving me the kernel hash error. I updated the dart.sdkPath to the correct path and restarted VS Code:
For example, in Windows:
Download dart sdk
Unzip it to c:\tools\dart-sdk or any other folder (make sure you rename or delete the existing dart-sdk folder)
ctrl-shift-p, type 'user settings (JSON)', open the json settings, and add:
"dart.sdkPath": "C:\\tools\\dart-sdk",
Update your system PATH environmental variable to point to the new dart-sdk and delete the reference to the old location.
Restart VS Code.
Note that Instead of This "dart.sdkPath": "D:\Dart\dart-sdk\bin" work well for me.
path should be included '\bin' also. It work for me
I have downloaded flutter_windows_1.17.1-stable and extracted it outside the program files, yet whenever I run the 'flutter doctor' command I am getting the message '\flutter\bin\cache was unexpected at this time.'
I have searched about this and found few solutions suggesting to delete the cache folder in bin of flutter directory, I did that, also added the path in environment variables, still having the same message.
Please, I need suggestion on how to fix this.
Thank you.
Faced similar issue, I initially created C:\Program Files(Manual)\Flutter
and added to user env path variable, but got Cache error, only when I moved to c:\src\Flutter it worked, I'd say paths with spaces (and or special chars '(' ')' ' ' aren't accepted
While you're using windows, go to the system environment variables from the search and edit flutter path variable, change it to the binary folder like C:\src\flutter\bin.
When I ran into this issue, I had already installed flutter several times to fix previous errors. This issue can happen if flutter is not installed in your environment variables, but it also happens if there is another duplicate or path to another bin in the same host. Also, make sure to check on all places for duplicate paths to two or more flutter bins. There are environment variables for your account, and environment variables for the entire PC. Be sure to check in both
Make sure you extract all your files to c:/src/flutter
If the problem is still there , then to run commands use c:/src/flutter/bin
I.e., include bin to your path
I had the same issue. I tried all the above solutions, but they did not work. So I also changed the path. The solution was to direct the CMD to Flutter's main directory.
Example: You want to run the code flutter doctor. You expect to open the CMD and run the code, so you get the result while you have configured the env and path, but it does not. To run the code, go to the same directory you installed the flutter and then run your codes;
E:\Program Files\flutter> flutter doctor
I hope it works for you as it worked for me. GL
1.) Move the Flutter folder to your C Drive.
2.) Create a new Folder called "src".
3.) Move Flutter folder to src.
4.) Add C:\src\flutter\bin to Path in Control Panel -> User Accounts -> Enviorments -> Path -> edit
first if you changed your flutter's location and if you gave path again to variables, you you need to dalate old path of flutter and it works.
I need to change some configuration information to use SpringToolSuite4. But when I downloaded SpringToolSuite4 4.1.2 and unziped, there isn't SpringToolSuite4.ini file. So I created one, but SpringToolSuite4 didn't reference to SpringToolSuite4.ini file when starting.
I solved the problem with these steps:
Open the commad terminal;
go to the location where you put the jar file;
Run "java -jar [****.jar]";
PS: Make sure you have java runtime installed in you machine and you have the correct environment settings.
Hope this could help you.
I guess this is an admin rights problem:
I have downloaded the self extracting .jar file:
spring-tool-suite-4-4.8.1.RELEASE-e4.17.0-win32.win32.x86_64.self-extracting.jar
I saved it in c:\Program Files (needs admin rights).
Double-clicked it (not as admin) -> Same error (cannot find the SpringToolSuite4.ini file).
I have started TotalCommander (you may use a differnt explorer) with admin rights -> Problem fixed.
Open jar with winrar. Open the "contents.zip". Move to "sts-4.8.0.RELEASE" folder in documents. After, we run the program.
jar:spring-tool-suite-4-4.8.0.RELEASE-e4.17.0-win32.win32.x86_64.self-extracting
You can solve the problem like this.
When I downloaded it for the second time. I also got this error(SpringToolSuite4.ini). That's how I passed. instead of downloading it again. Downloading it again didn't work.
right click on the sts icon inside the extracted sts-bundle package and select show content.