I am new to Flutter, and after installing it, I got this error when I tried to create a project.
[hello_world] flutter create --ios-language swift --android-language kotlin .
Failed to open or create the artifact cache lockfile: "FileSystemException: Cannot open file, path = '/home/raphael/flutter/flutter/bin/cache/lockfile' (OS Error: Permission denied, errno = 13)"
Please ensure you have permissions to create or open /home/raphael/flutter/flutter/bin/cache/lockfile
Failed to open or create the lockfile
exit code 1
I can't find any way to fix this, so I'd be glad if someone helps me :)
Thank you!
Add the permissions your app needs to the android/app/src/main/AndroidManifest. xml. Put the permissions in the manifest tag, infront of the application tag. <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.
In iOS, we require to add location permission Info. Now open an Info. plist file and add the below code based on the requirement. Change a string text to know why your application requires this permission. In iOS, all the permissions are default disabled.
Check permission for the mentioned directory via:
ls -l /home/raphael/flutter/
the flutter subfolder in there should have the same user id (or the group) as your current user, with whom you are trying to create the project.
If not, while being in the folder mentioned above, try to change permission on the folder via:
chown -R YOUR_USERNAME flutter
Run the first command again to verify that the apropriate user is now shown on the folder. Then try to create the project again.
Try this:
sudo chown -R [user]:root /opt/flutter
It worked for me on Manjaro Linux.
Try this, worked in my ubuntu 18.04.
First set the ownership of the folder:
sudo chown -R $USER:$USER ~/development/flutter
If you still have the error set this permission:
sudo chmod 754 development/flutter/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With