flutter - Flutter Null 安全迁移说“包不存在”
问题描述
Flutter Null 安全迁移
我正在尝试将我的项目迁移到 Flutter Null 安全版本,并且我正在遵循这个官方迁移指南。
当我运行第二个命令时,它说
Package doesn't exist (the Flutter SDK is not available).
我跑的命令
我@My-MacBook-Air my_project %dart --version
Dart SDK version: 2.12.0 (stable) (Thu Feb 25 19:50:53 2021 +0100) on "macos_x64"
我@My-MacBook-Air my_project %dart pub outdated --mode=null-safety
Package doesn't exist (the Flutter SDK is not available).
颤振医生输出
me@My-MacBook-Air my_project % `flutter doctor -v`
Flutter (Channel beta, 2.0.2, on macOS 11.2.3 20D91 darwin-x64, locale en-IN)
• Flutter version 2.0.2 at /Users/me/flutter
• Framework revision 8962f6dc68 (9 days ago), 2021-03-11 13:22:20 -0800
• Engine revision 5d8bf811b3
• Dart version 2.12.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/me/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/me/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.51.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.17.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 11.2.3 20D91 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90
• No issues found!
解决方案
Try flutter pub outdated --mode=null-safety
,应该会显示你的包依赖项的迁移状态。
推荐阅读
- python - 基于上下文和历史数据的预测类
- python - 有没有办法使用 mpld3 将 matplotlib 3D 平面转换为交互式 html?
- jquery - 无法选择 Angular DataTables 中所有页面的记录
- r - 包移动 spTransform
- mlflow - 在 mlflow.yml 中指定主机和端口并运行“kedro mlflow ui”,但主机和端口仍然默认(localhost:5000)不会改变
- android - 更改 Android 加密算法以更新 Google Play 上的应用程序的问题 - 从 AES/ECB/PKCS5Padding 到 AES/GCM/NoPadding
- javascript - 在项目中使用 Owl Carousel
- c# - 使用动作调用通用方法
- javascript - 如何在 html 文本编辑器中保存多行文本?
- azure - 在 azure 数据工厂中删除数据集