全部产品
云市场
云游戏

mPaaS Extension 打开 iOS 项目失败

更新时间:2020-03-25 20:54:00

错误描述

通过 mPaaS Extension 打开 iOS 项目失败,报错如下:

  1. 错误码:1
  2. 错误描述:undefined method `display_name' for nil:NilClass [Errno 1] (NoMethodError)

error info

解决方法

  1. 根据提示,在 问题报告 弹框中点击 诊断,生成诊断日志。
    diagnose
  2. 打开诊断日志 mpaas.log,查看出错时脚本执行的调用栈。例如下方调用栈表明在执行 search_from_build_phase 阶段遭遇到一个空值。
    1. [2020-02-03 12:34:12 +0800][mpaas][INFO](version.rb 63):
    2. [2020-02-03 12:34:30 +0800][mpaas][ERROR](entry.rb 37): undefined method `display_name' for nil:NilClass
    3. [2020-02-03 12:34:30 +0800][mpaas][ERROR](entry.rb 44): [!] undefined method `display_name' for nil:NilClass [Errno 1] (NoMethodError)
    4. [2020-02-03 12:34:30 +0800][mpaas][ERROR](entry.rb 44):
    5. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-common-1.1.38/lib/mpaas-common/xcode_helper/build_phase.rb:39:in `block (2 levels) in search_from_build_phase'
    6. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-common-1.1.38/lib/mpaas-common/xcode_helper/build_phase.rb:39:in `each'
    7. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-common-1.1.38/lib/mpaas-common/xcode_helper/build_phase.rb:39:in `find'
    8. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-common-1.1.38/lib/mpaas-common/xcode_helper/build_phase.rb:39:in `block in search_from_build_phase'
    9. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-common-1.1.38/lib/mpaas-common/xcode_helper.rb:195:in `project_read'
    10. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-common-1.1.38/lib/mpaas-common/xcode_helper/build_phase.rb:37:in `search_from_build_phase'
    11. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-project-1.1.16/lib/mpaas-project/project.rb:123:in `block in parse_using_mobile_framework'
    12. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-project-1.1.16/lib/mpaas-project/project.rb:119:in `each'
    13. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-project-1.1.16/lib/mpaas-project/project.rb:119:in `parse_using_mobile_framework'
    14. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-project-1.1.16/lib/mpaas-project/project.rb:84:in `parse_mpaas_targets='
    15. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-core-1.2.27/lib/mpaas-core/resolver.rb:23:in `initialize'
    16. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command/project/target.rb:47:in `new'
    17. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command/project/target.rb:47:in `block in project_structure'
    18. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-common-1.1.38/lib/mpaas-common/xcode_helper.rb:158:in `block in parse_project_structure'
    19. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-common-1.1.38/lib/mpaas-common/xcode_helper.rb:156:in `map'
    20. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-common-1.1.38/lib/mpaas-common/xcode_helper.rb:156:in `parse_project_structure'
    21. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command/project/target.rb:43:in `project_structure'
    22. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command/project/target.rb:33:in `run'
    23. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:127:in `block in run'
    24. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:91:in `assert'
    25. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:127:in `run'
    26. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:127:in `block in run'
    27. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:91:in `assert'
    28. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:127:in `run'
    29. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/entry.rb:19:in `start'
    30. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/bin/mpaas:11:in `<top (required)>'
    31. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/bin/mpaas:23:in `load'
    32. /Applications/mPaaSPlugin.app/Contents/Resources/bundle/bin/mpaas:23:in `<main>'
    33. [2020-02-03 12:35:04 +0800][mpaas][DEBUG](command.rb 166): 当前执行命令: diagnose report -o /Users/donglei/Library/Logs/com.mpaas.MPaaSIDEPlugin --verbose
    34. [2020-02-03 12:35:04 +0800][mpaas][DEBUG](command.rb 167): ------------------------------
    35. [2020-02-03 12:35:04 +0800][mpaas][INFO](ui_logger.rb 141): >>> 检查环境
    36. [2020-02-03 12:35:04 +0800][mpaas][INFO](report.rb 32): -- General --
  3. 通过 Xcode 打开原有项目,查看 Build Phase 中的设置,排查是否存在空引用。例如本例中:
    build phase
  4. 删除空引用后,即可重新通过 mPaaS Extension 打开项目。