如何解决尝试使用我的 m1 mac 运行我的 Flutter 应用程序时出错
每次我尝试运行我的 Flutter 应用程序时都会收到以下错误。我真的尝试了很多来修复它,但仍然没有修复错误。
在调试模式下在 iPhone 12 Pro Max 上启动 lib/main.dart... 正在运行 pod 安装... CocoaPods 的输出: ↳ 准备
Analyzing dependencies
Inspecting targets to integrate
[!] Unable to find a target named `testing_gowtham` in project `Runner.xcodeproj`,did find `Runner`.
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer/target_inspector.rb:108:in `compute_targets'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer/target_inspector.rb:40:in `compute_results'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1189:in `block (3 levels) in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1187:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1187:in `block (2 levels) in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1185:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1185:in `block in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1180:in `inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:106:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
运行 pod install 时出错 在 iPhone 12 Pro Max 上启动应用程序时出错。
解决方法
试试这个:
在 M1 中安装 Cocoa Pods
- sudo gem 安装 cocoapods
- sudo gem install ffi
- arch -x86_64 sudo gem install cocoapods -n /usr/local/bin
- sudo gem install cocoapods -n /usr/local/bin
安装 ffi
- sudo arch -x86_64 gem install ffi
#update repo
- arch -x86_64 pod install --repo-update
Flutter iOS 构建
- 扑通干净
- flutter build ios
在flutter项目的iOS文件夹重新安装依赖
- arch -x86_64 pod 安装
请follow this article
安装 coca-pods。当我在 Macbook M1 上设置 flutter 时,我也遵循了这篇文章。
-> 确保您在终端中启用了 rosetta(在下面的文章中讨论)
https://medium.com/codex/simple-way-to-use-cocoapods-on-m1-ac9e22cf7e1c
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。