我在运行flutter时遇到了问题。一旦我运行flutter,它就会在可视化代码中显示以下错误,这是任何解决方案。我运行flutter医生,不知道问题是不是来自细节。
Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling
software rendering with "--enable-software-rendering".
Launching lib/main.dart on sdk gphone x86 in debug mode...
**env: bash\r: No such file or directory**
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 2.9s
*Exception: Gradle task assembleDebug failed with exit code 127*```
Just in case you need the Flutter Doctor here is it:
```Doctor summary (to see all details, run flutter doctor -v):
darwin Flutter (通道稳定,1.22.4,在macOS 11.0.1 20B50✓-x64上,区域设置为en-GB)
✓Android工具链-为Android设备开发(Android SDK版本30.0.2)
适用于iOS和macOS的✗Xcode开发
✗ 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
✓安卓工作室(4.0版)
好了!IntelliJ IDEA旗舰版(2019.1版)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✓与代码(版本1.54.1)
连接✓的设备(1个可用)
好了!医生在两个类别中发现问题。`
发布于 2021-05-26 15:25:44
如下面这行所示
**env: bash\r: No such file or directory**
您似乎已经下载了Flutter的Windows二进制文件,但您使用的是macOS。您应该下载正确的二进制文件并重新安装Flutter。请在此处查看更多信息:https://github.com/flutter/flutter/issues/27076#issuecomment-487300955
发布于 2021-05-26 15:21:24
你下载VS代码中的颤动和飞镖插件了吗?一旦完成本网站文章https://giancarlocode.com/flutter-tutorials/how-to-install-flutter-on-windows-10-on-visual-studio-code-and-android-studio/中提到的步骤
https://stackoverflow.com/questions/67700190
复制相似问题