android - 颤振:添加http依赖项时出错
问题描述
我正在flutter docs中研究flutter 网络。我完全按照指导进行,但是当我添加 http 依赖项然后单击时Packages get
出现错误。怎么了?感谢您的任何建议。
dependencies:
flutter:
sdk: flutter
qrscan: ^0.2.17
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
http: ^0.12.2 // http dependency I added
错误信息如下
Running "flutter pub get" in myProject...
Unexpected character (at character 1)
<html>
^
dart:convert jsonDecode
package:pub/src/source/hosted.dart 190:17 BoundHostedSource._fetchVersions
===== asynchronous gap ===========================
dart:async _CustomZone.runUnary
package:pub/src/rate_limited_scheduler.dart 82:30 RateLimitedScheduler._processNextTask.runJob
package:pub/src/rate_limited_scheduler.dart 85:30 RateLimitedScheduler._processNextTask
dart:async new Future.sync
package:pool/pool.dart 126:18 Pool.withResource.<fn>
This is an unexpected error. Please run
pub --trace '--verbosity=warning' get --no-precompile
and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
pub get failed (65; and include the logs in an issue on https://github.com/dart-lang/pub/issues/new)
Process finished with exit code 65
解决方案
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.3
http: ^0.12.2 // http dependency I added
qrscan: ^0.2.17
请按此顺序编写代码
推荐阅读
- visual-studio - Visual Studio 调试模式下奇怪的内存内容显示
- cordova - 在通过 Wi-Fi 运行 iOS 13.1.2 的 iPad 上审核时,我的应用程序因应用程序中的错误而被拒绝
- python - 网页抓取时 BeautifulSoup 停止而没有抛出错误
- sql - 我无法在我的 SQL 语句中解决此错误
- html - 如何使用前/后元素切片背景颜色
- jquery - 在jquery中的href中删除#之后的所有内容
- reactjs - 处理导航项目选择的最佳方法是什么?
- django - 在 Django 中使用 Ajax 获取表单提交的数据时出现 MultiValueDictKeyError
- c# - System.IO.FileNotFoundException:无法加载文件或程序集'Microsoft.EntityFrameworkCore,版本 = 2.2.0.0,
- pci - PCIe 端点如何记住其总线设备功能编号?