【发布时间】:2020-05-09 04:02:19
【问题描述】:
我没有使用 GIT。正如我看到的一些帖子/问题,用户提到他们正在使用 GIT,因此他们遇到了错误。
昨天,我添加了 Image Cropper 插件,然后我重新启动了机器。重启后开始报错。
The current Flutter SDK version is 0.0.0-unknown.
Because image_cropper 1.2.1 requires Flutter SDK version ^1.12.13 and no versions of image_cropper match >1.2.1 <2.0.0, image_cropper ^1.2.1 is forbidden.
So, because demoapp depends on image_cropper ^1.2.1, version solving failed.
pub get failed (1; So, because demoapp depends on image_cropper ^1.2.1, version solving failed.)
Exited (1)
我运行 Flutter version 命令 -> 下面是输出。
Flutter 1.12.13+hotfix.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f139b11009 (6 weeks ago) • 2020-03-30 13:57:30 -0700
Engine • revision af51afceb8
Tools • Dart 2.7.2
我做了 Flutter Clean 和 Flutter Pub Get 他们都没有解决问题。
我运行 Flutter Doctor,这是输出。
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.3 19D76, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the
Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
[✓] Android Studio (version 3.1)
[✓] VS Code (version 1.44.2)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
我从一开始就没有使用 Xcode。
关于如何解决此问题的任何建议。
编辑
我通过运行 echo $PATH 检查了路径。
/Users/rahul/Desktop/flutter/bin
路径也在那里。
编辑 2 Flutter 升级也没有帮助。
【问题讨论】:
-
它是否与stackoverflow.com/questions/60897315/… 有关 - 我描述了 pubspec.lock 和 pubspec.yaml 如何具有用于 Flutter 版本控制的奇怪语法。或者,Flutter 可能已经损坏并且 Flutter 医生没有看到它。在这种情况下,重新安装 Flutter 应该是一个简单的解决方法。
标签: flutter