[Solved] Flutter failed to write to a file at ʺC:\flutter\versionʺ

In this post, we are going to show you how to solve the error 'Flutter failed to write to a file at "C:\flutter\version". The flutter tool cannot access the file or directory. Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.' see the solution below to solve this issue.

Flutter failed to write to a file at "C:\Users\Hari Pd. Chaudhary\Documents\flutter_sdk\flutter\version". The flutter
tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current
user.

ALTER TABLE `opd_list` ADD `exp_date` VARCHAR(255) NOT NULL DEFAULT '' AFTER `ins_no`; 

This error occurs when you have no permission to write in the folder where Flutter SDK is located. When you are installing a new package to your Flutter project, but the Flutter couldn't able to save the downloaded package, this error may occur. Or in other write cased. See the solution:

You may have disabled unauthorized changes on the folder to be protected from Ransomeware. To allow it, go to Windows Security=>Virus & threat protection=>Manage settings=>Controlled folder access=>Turn off Controlled folder access . 

You have to give permission to your username to access that folder. To give permission, hit the command below:

sudo chown -R <your_username> /flutter_sdk_path/

Don't forget to replace your username and flutter the SDK path.

In MacOS, give permission to the folder where Flutter is not allowed to write. 

In this way, you can solve the error "Flutter failed to write to a file at "C:\flutter\version"' of Flutter.

No any Comments on this Article


Please Wait...