我无法解决在调试模式下从Visual Studio代码启动Flutter应用程序时出现的以下错误。
错误:
Launching lib/app/main_dev.dart on Austris iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: P4CFB6V724
Warning: CocoaPods not installed. Skipping pod install.
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
Exited (sigterm)
Exception: CocoaPods not installed or not in valid state.
Cocoapods就在那里,我现在可能已经重装了几十次了。两者都有-使用gem和brew。似乎什么都不起作用。我尝试过flutter clean
,重新安装flutter,降级flutter版本(低至1.17.5)。这个错误似乎只有在我通过Xcode归档一个iOS应用程序之后才会发生。
Flutter医生也没有抱怨任何事情。奇怪的是,我可以通过命令行(使用flutter run
)启动应用程序。
下面是flutter doctor -v
的输出
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale en-LV)
• Flutter version 1.20.4 at /Users/austris/Documents/DEV/flutter
• Framework revision fba99f6cf9 (34 hours ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/austris/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Users/austris/Library/Android
• ANDROID_SDK_ROOT = /Users/austris/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_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.9.3
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.49.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.1
[✓] Connected device (1 available)
• Austris iPhone (mobile) • ios • iOS 13.7
发布于 2020-09-16 11:09:05
考虑重新安装vscode
。它会自动解决你的问题。祝你编码愉快!
发布于 2021-05-31 07:50:03
我用的是Macbook Air M1。
对我来说,它是vs代码的brew版本。使用microsoft works提供的apple silicon版本。
https://stackoverflow.com/questions/63916913
复制