Flutter Warning: CocoaPods not installed. Skipping pod install.

举报
yechaoa 发表于 2022/05/31 00:33:47 2022/05/31
【摘要】 报错 flutter项目在运行到ios 模拟器的时候报错: Warning: CocoaPods not installed. Skipping pod install. 1 还有 Using n...

报错

flutter项目在运行到ios 模拟器的时候报错:

Warning: CocoaPods not installed. Skipping pod install.

  
 
  • 1

还有

Using new build systemnote: Planning buildnote: Constructing build descripti....

  
 
  • 1
Xcode’s output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
Debug.xcconfig line 1: Unable to find included file "Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig"
Debug.xcconfig line 1: Unable to find included file “Pods/Target Support
Files/Pods-Runner/Pods-Runner.debug.xcconfig”
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use -v to see
invocation)

Could not build the application for the simulator.
Error launching application on iPhone XR.

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

具体报错没记录,一开始也没想着会有这么麻烦。


提示

官方给出了两个提示执行命令:

brew install cocoapods
pod setup

  
 
  • 1
  • 2

这个其实在一开始配环境执行flutter doctor的结果之后也给了提示,也是配置mac环境的条件。
但是本来项目是可以运行到ios模拟器的,新项目也是可以运行的,但是最近项目改动较多,无从查起,没办法只能硬着头皮解决了。

在网上搜了一圈,并没有相关的解决方案,没办法,站不了巨人的肩上了,只能自己摸索了。


思路一

按照指示在终端执行brew install cocoapods,等了好一会,开始出现下载

==> Downloading https://homebrew.bintray.com/bottles/cocoapods-1.7.5.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/5a/5a70fd60007975ce224824b1a8852ba9124faa6753061d0ecc024be4cebd6e8b?__gda__=exp=1565624237~hmac=b87d5d0111b49f600da053951890

  
 
  • 1
  • 2

下载到百分之几的时候就失败了,然后又重试,结果在百分之六十多的时候又失败了,应该是要fq,国内速度较慢。

然后又开始在网上搜CocoaPods的安装教程,搜了一圈下来,看着都麻烦。


思路二

然后我尝试在Android Studio自带的terminal中直接执行brew install cocoapods,默认是在项目根目录执行的,

yechaodeMacBook-Pro:wanandroid_flutter yechao$ brew install cocoapods

  
 
  • 1

会有error提示

Error: Another active Homebrew update process is already in progress.
Please wait for it to finish or terminate it to continue.

  
 
  • 1
  • 2

但是可以下载,而且速度挺快的,

==> Downloading https://homebrew.bintray.com/bottles/cocoapods-1.7.5.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/5a/5a70fd60007975ce224824b1a8852ba9124faa6753061d0ecc024be4cebd6e8b?__gda__=exp=1565624237~hmac=b87d5d0111b49f600da053951890
######################################################################## 100.0%

  
 
  • 1
  • 2
  • 3

下载完成之后在执行 pod setup,又是一顿下载,这个要等一会了。

yechaodeMacBook-Pro:wanandroid_flutter yechao$ pod setup
Setting up CocoaPods master repo
  $ /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git --progress -- master
  Cloning into 'master'...
  remote: Enumerating objects: 260, done.        
  remote: Counting objects: 100% (260/260), done.        
  remote: Compressing objects: 100% (249/249), done.        
  Receiving objects:  10% (361304/3368611), 72.04 MiB | 57.00 KiB/s  

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

完了之后再次尝试运行到ios模拟器,

ok,运行成功!


文章来源: blog.csdn.net,作者:yechaoa,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/yechaoa/article/details/99356997

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。