Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: pub get failed (66)

When i try to implement scoped model, i get this error message:

[flutter_course] flutter packages get Running "flutter packages get" in flutter_course...
Creation of temporary directory failed, path = 'C:\Program Files\flutter.pub-cache_temp\dir' (OS Error: Access is denied. , errno = 5)

name: flutter_course
description: A new Flutter project.


version: 1.0.0+1

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  scoped_model: ^1.0.1

dev_dependencies:
  flutter_test:
    sdk: flutter
like image 722
salah112 Avatar asked Jan 17 '19 10:01

salah112


People also ask

What is flutter pub get?

Get is one of the commands of the pub tool. $ dart pub get [options] This command gets all the dependencies listed in the pubspec. yaml file in the current working directory, as well as their transitive dependencies.

Can I remove Pub cache?

FYI: You can delete the pub cache manually. Pub will redownload the needed packages on the next pub get.


2 Answers

Enable in your windows settings the Developer Mode. Enable Developer Mode in Windows

like image 94
chickahoona Avatar answered Oct 03 '22 09:10

chickahoona


Turning on developer mode solved my issue on Windows 10.

  1. Delete temp folder in pub cache.
  2. Do pub repair flutter pub cache repair.
  3. Turn on developer mode in windows settings.
  4. Flutter clean and delete pub.lock if exist.
  5. Try flutter pub get.

This worked for me.

like image 32
ANAS AJI MUHAMMED Avatar answered Oct 03 '22 10:10

ANAS AJI MUHAMMED