"flutter pub get" A required privilege is not held by the client

Viewed 14794

I keep getting this error on Android Studio flutter project, although flutter doctor command shows no issues!

    Cannot create link, path = 'C:\Users\UserName\AppData\Local\Pub\Cache\_temp\dir90f89940\ios\Classes\FLTFirebaseAuthPlugin.m' 
(OS Error: A required privilege is not held by the client.
, errno = 1314)
pub get failed (66; , errno = 1314))

I tried with pub upgrade which seams to get dependencies correctly and start updating them, but I didn't know why pub get give this error.

Update

A workaround seems to be running Android Studio as administrator!

7 Answers

I have switched ON developer mode in Windows settings (Settings -> Update & security -> For developers) . It worked for me.

Like so:

enter image description here

I'm using vscode I just opened it as administrator and everything works find.

Just run your PowerShell in administrator mode

the

cd to your project and run

flutter pub get

If you are using Android Studio:

open Android Studio with "Run as administrator"

I wanted to add this solution because when you have accounts managed by your company this is a common problem. Just go to your quick acces in Start then:

  • Right Click > More > Open File Location When the Explorer Opens Right Click again on the AS Icon (quick access), then:
  • Properties > Advanced ... > Run as Administrator So you can run always by default as Administrator.

Regards.-

Just run your IDE whether VS Code or Android Studio as Administrator . It solves the issue

Other temporary solution is that making pub cache and then trying flutter pub get.

https://spikez.tistory.com/439


Solution :

1.  flutter pub get

   ==> error will be occurred.

[your flutter sdk folder]\flutter.pub-cache_temp\ dir7d36fb45\macos\Classes\FlutterBluePlugin.h' (OS Error: 지정된 파일을 찾을 수 없습니다. , errno = 2)

  1. copy dir7d36fb45  to [your flutter sdk folder]\flutter.pub-cache\hosted\pub.dartlang.org 
  2. change name dir7d36fb45 to flutter_blue-0.8.0
  3. cd flutter_blue-0.8.0 (created by you)
  4. create pubspec.yaml in flutter_blue-0.8.0 folder
  5. fill below content in pubspec.yaml
  6. now you have done preparing flutter_blue cache  :)
  7. lets do, flutter pub get maybe it will be work. I know it is a temporary solution. but I believe it will help you understand how to work pub get..   If you need new pubspec.yaml , you can find out in here  : https://github.com/pauldemarco/flutter_blue/blob/master/pubspec.yaml
Related