美文网首页
2022-06-06 NoMethodError - undef

2022-06-06 NoMethodError - undef

作者: 我是小胡胡分胡 | 来源:发表于2022-06-06 18:18 被阅读0次

    NoMethodError - undefined method `downcase' for nil:NilClass

    Error

    NoMethodError - undefined method `downcase' for nil:NilClass
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object/group.rb:445:in `block in sort'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object_list.rb:182:in `sort!'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object_list.rb:182:in `sort!'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object/group.rb:431:in `sort'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:183:in `sort_recursively'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:180:in `block (2 levels) in sort_recursively'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:180:in `each'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:180:in `block in sort_recursively'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:178:in `each'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:178:in `sort_recursively'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:180:in `block (2 levels) in sort_recursively'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:180:in `each'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:180:in `block in sort_recursively'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:178:in `each'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:178:in `sort_recursively'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:175:in `block in sort_recursively'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:173:in `each'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project/object.rb:173:in `sort_recursively'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:811:in `sort'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:81:in `block in save_projects'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:80:in `each'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:80:in `save_projects'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:63:in `write!'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:330:in `block in create_and_save_projects'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:309:in `create_and_save_projects'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:301:in `generate_pods_project'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:180:in `integrate'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:167:in `install!'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `load'
    /opt/homebrew/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'
    

    ――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

    [!] Oh no, an error occurred.

    解决方法:

      s.source_files = 'WIMUIKit/**/*.{h,m,mm}','frameworks/wvr_lib/include/*.{h}'
        s.public_header_files = 'WIMUIKit/**/*.{h}','frameworks/wvr_lib/include/*.{h}'
    
    

    改成

     
     s.source_files = 'WIMUIKit/**/*.{h,m,mm}' 
       s.public_header_files = 'WIMUIKit/**/*.{h}','frameworks/wvr_lib/include/*.{h}'
    
    

    分析原因:
    public_header_files、 source_files 互相包含了
    在public_header_files出现了的.a的inclue的头文件,需要在source_files中同时出现的去掉

    但是过了一段时间:

    写成了下面方式:

      s.source_files = 'WIMUIKit/**/**/*.{h,m,mm}'
     
      s.public_header_files = 'WIMUIKit/**/*.{h}', 'WIMUIKit/frameworks/wvr_lib/include/*.{h}'
      s.vendored_libraries = 'WIMUIKit/frameworks/wvr_lib/*.{a}'
    

    又报了这个错误了

    那么我尝试把frameworks 改一个其他名字:
    改成sframeworks

    改成

      s.source_files = 'WIMUIKit/**/**/*.{h,m,mm}'
     
      s.public_header_files = 'WIMUIKit/**/*.{h}', 'WIMUIKit/sframeworks/wvr_lib/include/*.{h}'
      s.vendored_libraries = 'WIMUIKit/sframeworks/wvr_lib/*.{a}'
    

    意外发现可以了

    那么,我大胆的下结论:

    这个文件名Frameworks 是特定的。 自己在设置cocopods podspec目录时候,避免用这个名字命名文件夹,存放代码和资源文件。

    相关文章

      网友评论

          本文标题:2022-06-06 NoMethodError - undef

          本文链接:https://www.haomeiwen.com/subject/whwjmrtx.html