Flutter installation not working?

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.

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.

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

flutter websocket connection issue