我正在尝试在Flutter中安装一个包(dynamic_theme)。当我运行flutter packages get -v
时,它甚至不尝试安装该包。
到目前为止,我已经尝试过:
- 运行
flutter packages get
- 重新启动我的电脑
- 更新Flutter
- 添加另一个包,但也未安装
- 更新Android Studio
在我的pubspec.yaml文件中,我已经放置了:
dependencies:
flutter:
sdk: flutter
firebase_core:
cupertino_icons: ^0.1.2
dynamic_theme: ^1.0.1 # the package does not install
uuid: 2.0.0 # the package does not install
在详细运行flutter packages get
时的日志中,当安装包时,它会输出:
[ +422 ms] Running "flutter packages get" in quiz_app... (completed in 0.4s)
[ +57 ms] Found plugin firebase_core at E:\Other\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.3.4\
[ +13 ms] Found plugin shared_preferences at E:\Other\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.2\
[ +141 ms] Found plugin firebase_core at E:\Other\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.3.4\
[ +6 ms] Found plugin shared_preferences at E:\Other\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.2\
[ +26 ms] "flutter get" took 718ms.
我原以为Flutter会自动下载和安装软件包,但实际上它只是检查已安装软件包的更新,例如firebase_core。
firebase_core
的版本?这是复制粘贴错误还是你实际的pubspec.yaml文件?我认为这可能是你的问题(看着你的注释)。目前可用的版本是0.3.4
。 - tomerpacific