dart-lang / pub

The pub command line tool
https://dart.dev/tools/pub/cmd
BSD 3-Clause "New" or "Revised" License
1.04k stars 224 forks source link

403 error in pub get flutter #3319

Closed mirdavinci closed 2 years ago

mirdavinci commented 2 years ago

i'm getting this error whole i want to get packages in flutter.

Authentication error (403) package:pub/src/authentication/client.dart 95:5 _AuthenticatedClient._throwAuthException package:pub/src/authentication/client.dart 60:9 _AuthenticatedClient.send ===== asynchronous gap =========================== package:pub/src/authentication/client.dart 133:12 withAuthenticatedClient ===== asynchronous gap =========================== package:pub/src/source/hosted.dart 788:22 BoundHostedSource._download. ===== asynchronous gap =========================== package:pub/src/io.dart 885:12 withTempDir ===== asynchronous gap =========================== package:pub/src/source/hosted.dart 785:5 BoundHostedSource._download ===== asynchronous gap =========================== package:pub/src/source/hosted.dart 623:7 BoundHostedSource.downloadToSystemCache ===== asynchronous gap =========================== package:pub/src/solver/result.dart 90:9 SolveResult.downloadCachedPackages.. ===== asynchronous gap =========================== package:pub/src/solver/result.dart 89:14 SolveResult.downloadCachedPackages. ===== asynchronous gap =========================== package:pub/src/solver/result.dart 85:5 SolveResult.downloadCachedPackages ===== asynchronous gap =========================== package:pub/src/entrypoint.dart 310:7 Entrypoint.acquireDependencies ===== asynchronous gap =========================== package:pub/src/command/upgrade.dart 123:5 UpgradeCommand._runUpgrade ===== asynchronous gap =========================== package:pub/src/command/upgrade.dart 112:7 UpgradeCommand.runProtected

sigurdm commented 2 years ago

We need more info here.

How is your network set up? Can you access pub.dev in a browser? Do you have a PUB_HOSTED_URL variable in your environment? What is your dart/flutter version?

What command are you running? What is your pubspec.yaml.

BenVihara commented 2 years ago

when i use "mqtt_client" library . i see this error .

mirdavinci commented 2 years ago

when i use "mqtt_client" library . i see this error It'll be solved by a good vpn or proxy this approach worked for me

mahanpyk commented 2 years ago

I had exactly the same problem and changed a few VPN, but it was still a problem and did not work

I used a service that changed DNS to fix the problem of sanctions and the problem was solved