问题描述
我仍然无法弄清楚这件事.我执行 flutter pub get
时收到此错误消息:
I still cannot figure this thing out. I got this error message when I do flutter pub get
:
但是我在 stable
频道中没有收到此消息.到目前为止,我始终只是来回切换.但我想一劳永逸地找到解决方案,因为某些任务需要在 master
或 dev
渠道中完成.
But I don't get this message in stable
channel.So far I always just switch back and forth. But I want to find the solution once and for all, because some tasks I need to do in master
or dev
channels.
这是我的 pubspec.yaml
文件
environment:
sdk: ">=2.7.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
# UI related packages
cupertino_icons: ^1.0.0
gradient_app_bar: ^0.1.3
bubbled_navigation_bar: ^0.0.4
titled_navigation_bar: ^3.6.0
bubble_tab_indicator: ^0.1.4
flutter_i18n: ^0.20.1
gradient_widgets: ^0.5.0
flutter_form_builder: ^3.14.0 # must be 3.14.0 because 3.14.1 will break
keyboard_dismisser: ^1.0.2
font_awesome_flutter: ^8.5.0
sliding_up_panel: ^1.0.2
lazy_load_scrollview: ^1.1.0
pull_to_refresh: ^1.6.2
scroll_to_index: ^1.0.6
date_time_format: ^1.0.0+4
like_button: ^1.0.1
# Login & App Store packages
flutter_facebook_login: ^3.0.0
google_sign_in: ^4.5.4
sign_in_with_apple: ^2.5.4
purchases_flutter: ^1.4.0
# Informing User / Loading
flutter_spinkit: ^4.0.0
progress_dialog: ^1.2.4
shimmer: ^1.1.1
flushbar: ^1.10.4
rflutter_alert: ^1.0.3
loading:
git:
url: git://github.com/leonzone/loading.git
path: loading
ref: 8f5a63f
# I/O, Cache & Databases
path: ^1.7.0
path_provider: ^1.6.16
shared_preferences: ^0.5.12+4
flutter_secure_storage: ^3.3.5
flutter_cache_manager: ^1.4.2
sembast: ^2.4.7+7
sembast_cloud_firestore_type_adapters:
git:
url: git://github.com/tekartik/sembast_flutter_more.dart
path: cloud_firestore_type_adapters
ref: dart2
version: '>=0.1.0'
# Code structure, connectivity & internal services
flutter_bloc: ^6.1.0
provider: ^4.3.2+2
http: ^0.12.1
equatable: ^1.2.5
simple_connectivity: ^0.1.1
network_image_to_byte: ^0.0.1
image_picker: ^0.6.7+11
image: ^2.1.14
package_info: ^0.4.1
flutter_device_type: ^0.2.0
audioplayers: 0.17.0
url_launcher: ^5.7.8
device_info: ^1.0.0
in_app_review: ^1.0.3
petitparser: ^3.0.2
convert: ^2.1.1
flutter_chips_input: ^1.9.3
vector_math: ^2.0.8
path_drawing: ^0.4.1
matrix_gesture_detector: ^0.1.0
# Social share packages
social_share_plugin: ^0.3.1+1
share: ^0.6.5+4
# Firebase packages
firebase_core: ^0.5.3
firebase_auth: ^0.18.4
cloud_firestore: ^0.14.4
firebase_storage: ^5.2.0
firebase_database: ^4.4.0
cloud_functions: ^0.7.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- assets/images/
- assets/i18n/
- assets/audio/
fonts:
- family: Varela Round
fonts:
- asset: fonts/VarelaRound-Regular.ttf
- family: Font Awesome
fonts:
- asset: fonts/FontAwesome-Regular.otf
这是我的 flutter医生
:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.25.0-5.0.pre.141, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.51.1)
[✓] Connected device (2 available)
• No issues found!
有人知道这是怎么回事吗?
Anyone knows whats wrong here?
再一次,我在 stable
频道中没有这个问题.
Once again, I don't have this problem in stable
channel.
非常感谢.
推荐答案
飞镖和扑扑小组正在过渡到 null-安全功能.它仍然处于beta版本(这就是为什么仅通过beta通道会收到此错误的原因).并非每个软件包都已升级为空安全性.您可以通过以下方式解决此问题:
The dart and flutter teams are transitioning to null-safety feature. It is still in beta (that is why you get this error just with the beta channel). Not every package are already upgraded to null-sefety. You can fix this issue either by:
- 要求软件包的开发者升级到null安全性
- 使用未启用空安全性的flutter版本
- 使用启用了null安全功能的程序包Beta版
还要此问题
这篇关于Pubspec.yaml解析版本在主通道中失败,但在Flutter中的稳定通道中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!