Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter http package get failed (69)

Tags:

flutter

dart

When trying to import http package I can see the red underlining as it is error.

In terminal I tried running "flutter clean" and then adding "http: ^0.12.0" to pubspeck.yaml and running "flutter packages get" but it shows: "Could not resolve URL "https://pub.dartlang.org". pub get failed (69)"

Packages like "flutter/material.dart" are correctly imported. Don't know what to do.

Could this be issue with http not being back-compatible with flutter 1.0?

like image 373
micchikk Avatar asked Sep 03 '25 08:09

micchikk


2 Answers

So the problem was I was behind proxy and added enviromental variables (https_proxy) as strings in quotation marks, where they should be added without " ". More here (https://www.dartlang.org/tools/pub/troubleshoot).

like image 139
micchikk Avatar answered Sep 04 '25 23:09

micchikk


On Linux/macOS:

$ export https_proxy=hostname:port

On Windows Command Prompt:

$ set https_proxy=hostname:port

On Windows PowerShell:

$ $Env:https_proxy="hostname:port"

If the proxy requires credentials, you can set them as follows.

On Linux/macOS:

$ export https_proxy=username:password@hostname:port

On Windows Command Prompt:

$ set https_proxy=username:password@hostname:port

On Windows PowerShell:

$ $Env:https_proxy="username:password@hostname:port"

For more information refer this link

like image 32
Ajay Thakur Avatar answered Sep 04 '25 21:09

Ajay Thakur