ポッドインストールエラー(NoMethodError-nil:NilClassの未定義のメソッド `size ')

ポッドインストールエラー(NoMethodError-nil:NilClassの未定義のメソッド `size ')

序文

最近、flutterプロジェクトのiOS環境を実行しているときに、次の3つのエラーが発生しました。長い間勉強した結果、ようやく解決策を見つけました。

  1. ポッドインストールエラー
  2. NoMethodError-nil:NilClassの未定義のメソッド `size '
  3. NoMethodError-nil:NilClassの未定義のメソッド `each '

質問のスクリーンショット

[!] 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

解決

Terminal
実行するためにFlutterでプロジェクトを開きます。

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

解決が完了したら、困っている学生を支援したいと思います~~

おすすめ

転載: blog.csdn.net/gjm_123/article/details/103877223