记一次pod install 错误解决方案
错误展示
执行完pod install 后的报错信息
[//]: # (pod install)
[//]: # (Analyzing dependencies)
[//]: # ()
[//]: # (――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――)
[//]: # ()
[//]: # (### Command)
[//]: # ()
[//]: # (```)
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod install)
[//]: # (```)
[//]: # ()
[//]: # (### Report)
[//]: # ()
[//]: # (* What did you do?)
[//]: # ()
[//]: # (* What did you expect to happen?)
[//]: # ()
[//]: # (* What happened instead?)
[//]: # ()
[//]: # ()
[//]: # (### Stack)
[//]: # ()
[//]: # (```)
[//]: # ( CocoaPods : 1.14.3)
[//]: # ( Ruby : ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22])
[//]: # ( RubyGems : 3.4.10)
[//]: # ( Host : macOS 13.6 (22G120))
[//]: # ( Xcode : 14.3.1 (14E300c))
[//]: # ( Git : git version 2.39.2 (Apple Git-143))
[//]: # (Ruby lib dir : /opt/homebrew/Cellar/ruby/3.2.2_1/lib)
[//]: # (Repositories : trunk - CDN - https://cdn.cocoapods.org/)
[//]: # (```)
[//]: # ()
[//]: # (### Plugins)
[//]: # ()
[//]: # (```)
[//]: # (cocoapods-deintegrate : 1.0.5)
[//]: # (cocoapods-plugins : 1.0.0)
[//]: # (cocoapods-search : 1.0.1)
[//]: # (cocoapods-trunk : 1.6.0)
[//]: # (cocoapods-try : 1.2.0)
[//]: # (```)
[//]: # ()
[//]: # (### Podfile)
[//]: # ()
[//]: # (```ruby)
[//]: # (target 'iosApp' do)
[//]: # ( use_frameworks!)
[//]: # ( platform :ios, '12.0')
[//]: # ( pod 'shared', :path => '../shared')
[//]: # (end)
[//]: # (```)
[//]: # ()
[//]: # (### Error)
[//]: # ()
[//]: # (```)
[//]: # (NoMethodError - undefined method `[]' for nil:NilClass)
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/xcodeproj-1.23.0/lib/xcodeproj/project.rb:232:in `initialize_from_file')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/xcodeproj-1.23.0/lib/xcodeproj/project.rb:113:in `open')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1194:in `block (2 levels) in inspect_targets_to_integrate')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1193:in `each')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1193:in `block in inspect_targets_to_integrate')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:64:in `section')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1188:in `inspect_targets_to_integrate')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:107:in `analyze')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:422:in `analyze')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:64:in `section')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:243:in `resolve_dependencies')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:162:in `install!')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command/install.rb:52:in `run')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command.rb:52:in `run')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/bin/pod:55:in `<top (required)>')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `load')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `<main>')
[//]: # (```)
[//]: # ()
[//]: # (――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――)
[//]: # ()
[//]: # ([!] Oh no, an error occurred.)
[//]: # ()
[//]: # (Search for existing GitHub issues similar to yours:)
[//]: # (https://github.com/CocoaPods/CocoaPods/search?q=undefined+method+%60%5B%5D%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 list throw NoMethodError - undefined method `version' for nil:NilClass)
[//]: # ( https://github.com/CocoaPods/CocoaPods/issues/11780 [open] [1 comment])
[//]: # ( 10 May 2023)
[//]: # ()
[//]: # (- Searching for inspections failed: undefined method `map' for nil:NilClass)
[//]: # ( https://github.com/CocoaPods/CocoaPods/issues/11584 [open] [4 comments])
[//]: # ( 14 Nov 2022)
[//]: # ()
[//]: # (- Intel cpu undefined method `map' for nil:NilClass)
[//]: # ( https://github.com/CocoaPods/CocoaPods/issues/11366 [open] [3 comments])
[//]: # ( 18 May 2022)
[//]: # ()
[//]: # (and 345 more at:)
[//]: # (https://github.com/cocoapods/cocoapods/search?q=undefined%20method%20%60%5B%5D%27%20for%20nil&type=Issues&utf8=✓)
[//]: # (tong@tongMacBook-Pro (master) [1] % pod update ~/work/code/weeder-app/iosApp)
[//]: # (Update all pods)
[//]: # (Updating local specs repositories)
[//]: # (Analyzing dependencies)
[//]: # ()
[//]: # (――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――)
[//]: # ()
[//]: # (### Command)
[//]: # ()
[//]: # (```)
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod update)
[//]: # (```)
[//]: # ()
[//]: # (### Report)
[//]: # ()
[//]: # (* What did you do?)
[//]: # ()
[//]: # (* What did you expect to happen?)
[//]: # ()
[//]: # (* What happened instead?)
[//]: # ()
[//]: # ()
[//]: # (### Stack)
[//]: # ()
[//]: # (```)
[//]: # ( CocoaPods : 1.14.3)
[//]: # ( Ruby : ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22])
[//]: # ( RubyGems : 3.4.10)
[//]: # ( Host : macOS 13.6 (22G120))
[//]: # ( Xcode : 14.3.1 (14E300c))
[//]: # ( Git : git version 2.39.2 (Apple Git-143))
[//]: # (Ruby lib dir : /opt/homebrew/Cellar/ruby/3.2.2_1/lib)
[//]: # (Repositories : trunk - CDN - https://cdn.cocoapods.org/)
[//]: # (```)
[//]: # ()
[//]: # (### Plugins)
[//]: # ()
[//]: # (```)
[//]: # (cocoapods-deintegrate : 1.0.5)
[//]: # (cocoapods-plugins : 1.0.0)
[//]: # (cocoapods-search : 1.0.1)
[//]: # (cocoapods-trunk : 1.6.0)
[//]: # (cocoapods-try : 1.2.0)
[//]: # (```)
[//]: # ()
[//]: # (### Podfile)
[//]: # ()
[//]: # (```ruby)
[//]: # (target 'iosApp' do)
[//]: # ( use_frameworks!)
[//]: # ( platform :ios, '12.0')
[//]: # ( pod 'shared', :path => '../shared')
[//]: # (end)
[//]: # (```)
[//]: # ()
[//]: # (### Error)
[//]: # ()
[//]: # (```)
[//]: # (NoMethodError - undefined method `[]' for nil:NilClass)
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/xcodeproj-1.23.0/lib/xcodeproj/project.rb:232:in `initialize_from_file')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/xcodeproj-1.23.0/lib/xcodeproj/project.rb:113:in `open')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1194:in `block (2 levels) in inspect_targets_to_integrate')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1193:in `each')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1193:in `block in inspect_targets_to_integrate')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:64:in `section')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:1188:in `inspect_targets_to_integrate')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer/analyzer.rb:107:in `analyze')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:422:in `analyze')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/user_interface.rb:64:in `section')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:243:in `resolve_dependencies')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/installer.rb:162:in `install!')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command/update.rb:63:in `run')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/lib/cocoapods/command.rb:52:in `run')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/cocoapods-1.14.3/bin/pod:55:in `<top (required)>')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `load')
[//]: # (/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `<main>')
[//]: # (```)
[//]: # ()
[//]: # (――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――)
[//]: # ()
[//]: # ([!] Oh no, an error occurred.)
[//]: # ()
[//]: # (Search for existing GitHub issues similar to yours:)
[//]: # (https://github.com/CocoaPods/CocoaPods/search?q=undefined+method+%60%5B%5D%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 list throw NoMethodError - undefined method `version' for nil:NilClass)
[//]: # ( https://github.com/CocoaPods/CocoaPods/issues/11780 [open] [1 comment])
[//]: # ( 10 May 2023)
[//]: # ()
[//]: # (- Searching for inspections failed: undefined method `map' for nil:NilClass)
[//]: # ( https://github.com/CocoaPods/CocoaPods/issues/11584 [open] [4 comments])
[//]: # ( 14 Nov 2022)
[//]: # ()
[//]: # (- Intel cpu undefined method `map' for nil:NilClass)
[//]: # ( https://github.com/CocoaPods/CocoaPods/issues/11366 [open] [3 comments])
[//]: # ( 18 May 2022)
[//]: # ()
[//]: # (and 345 more at:)
[//]: # (https://github.com/cocoapods/cocoapods/search?q=undefined%20method%20%60%5B%5D%27%20for%20nil&type=Issues&utf8=✓)
最终解决方法
前几天修改了下面两个文件,把这两个文件修改回来就可以正常了,具体原因不清楚
iosApp/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme iosApp/iosApp.xcodeproj/project.pbxproj