prz*_*adu 11 xcode ios cocoapods flutter
我已经cocoapods
在我的 Mac 上安装了。
$ pod --version
1.9.3
$ which pod
/Users/user/.rbenv/shims/pod
$ which gem
/Users/user/.rbenv/shims/gem
$ which ruby
/Users/user/.rbenv/shims/ruby
Run Code Online (Sandbox Code Playgroud)
但是,如果我添加设备特定代码,例如设置 firebase 或添加地理定位器插件,然后单击 Android studioRun
绿色按钮,我总是会收到以下错误:
Launching lib/main.dart on iPhone 11 Pro in debug mode...
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
CocoaPods not installed or not in valid state.
Error launching application on iPhone 11 Pro.
Run Code Online (Sandbox Code Playgroud)
没用
最后,如果我在终端中运行以下命令,它就会按预期工作:
flutter build ios --simulator
flutter run
Run Code Online (Sandbox Code Playgroud)
所以,我认为这是 Android Studio 的问题。还有其他人面临这个问题,并且有解决这个问题的方法吗?
这不是android studio的问题,而是flutter的pod版本问题。请降级您的 cocoapods 并重试。
这是我的解决方案。
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.7.5
pod setup
sudo gem install cocoapods
Run Code Online (Sandbox Code Playgroud)
更新: 如果仍有问题,请在 xcode 项目上打开它并尝试运行它。一旦你解决了 xcode 上的问题,它也将在 android studio 上运行
更新2: 请检查您的flutter sdk路径。如果有任何大写字母,则可能会导致问题。
更新3:如果以上方法都不起作用,请尝试在终端上使用Android Studio。
open /Applications/Android\ Studio.app
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6226 次 |
最近记录: |