Flutter HTTP软件包失败(69) [英] Flutter http package get failed (69)

查看:102
本文介绍了Flutter HTTP软件包失败(69)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试导入 http 软件包时,我看到红色的下划线是错误的。

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

在终端中,我尝试运行 flutter clean ,然后将 http:^ 0.12.0添加到 pubspeck.yaml 并运行 flutter软件包获取,但显示:
无法解析URL https://pub.dartlang.org
pub失败(69)

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)"

已正确导入 flutter / material.dart之类的软件包。不知道该怎么办。

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

这可能是 http 与flutter 1.0向后兼容的问题吗?

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

推荐答案

在Linux / macOS上:

On Linux/macOS:

$ export https_proxy=hostname:port

在Windows命令提示符下:

On Windows Command Prompt:

$ set https_proxy=hostname:port

在Windows PowerShell上:

On Windows PowerShell:

$ $Env:https_proxy="hostname:port"

如果代理需要凭据,则可以如下设置它们。

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

在Linux / macOS上:

On Linux/macOS:

$ export https_proxy=username:password@hostname:port

在Windows命令提示符上:

On Windows Command Prompt:

$ set https_proxy=username:password@hostname:port

在Windows PowerShell上:

On Windows PowerShell:

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

有关更多信息,请参考此链接

这篇关于Flutter HTTP软件包失败(69)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆