pod install error(NoMethodError - undefined method `size’ for nil:NilClass)

pod install error(NoMethodError - undefined method `size’ for nil:NilClass)

前言

最近在运行flutter项目iOS环境时,遇到了以下3个错误,研究了好久,终于找到了解决方案,Mark一下

  1. pod install error
  2. NoMethodError - undefined method `size’ for nil:NilClass
  3. NoMethodError - undefined method `each’ for nil:NilClass

问题截图

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=undefined+method+%60size%27+for+nil%3ANilClass&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
 - pod    install  error
   https://github.com/CocoaPods/CocoaPods/issues/9453 [open] [1 comment]
   3 days ago

 - NoMethodError - undefined method `size' for nil:NilClass
   https://github.com/CocoaPods/CocoaPods/issues/9295 [closed] [2 comments]
   04 Nov 2019

 - NoMethodError - undefined method `each' for nil:NilClass
   https://github.com/CocoaPods/CocoaPods/issues/9239 [closed] [3 comments]
   6 weeks ago

and 2 more at:
https://github.com/cocoapods/cocoapods/search?q=undefined%20method%20%60size%27%20for%20nil&type=Issues&utf8=[!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

问题的相关连接:

https://github.com/CocoaPods/CocoaPods/search?q=undefined+method+%60size%27+for+nil%3ANilClass&type=Issues

解决办法

在flutter项目里打开 Terminal
依次执行:

flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
flutter build iOS

解决完毕,希望对有需要的同学有所帮助~~

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Lester_ge

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值