Insufficient permissions to the resource in https://pub.dartlang.org package repository

Viewed 1549

I got this error when I delete flutter-sdk and replace new flutter-sdk

Insufficient permissions to the resource in https://pub.dartlang.org package repository. You can modify credential using:
    pub token add https://pub.dartlang.org
Running "flutter pub get" in flutter_tools...                           
pub get failed (65;     pub token add https://pub.dartlang.org)

flutter version :

Flutter 2.8.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision cf44000065 (6 days ago) • 2021-12-08 14:06:50 -0800
Engine • revision 40a99c5951
Tools • Dart 2.15.0
4 Answers

I had the same issue. You need to use a VPN.

First delete credentials:

rm ~/.pub-cache/credentials.json

After you try:

flutter upgrade
flutter pub cache repair

I just restart my system and then try to do "flutter pub get" and it works :|, And also I change my VPN.

To solve this problem, make sure that follow these steps:

  1. run flutter clean
  2. make sure that you have reliable internet connection and if you are using VPN, make sure it has reliable connection
  3. run your project again.
Related