Failed to open an iOS project with the mPaaS Extension

Updated at:

Problem description

Opening an iOS project with the mPaaS Extension fails with the following error:

Error code: 1
Error description: undefined method `display_name' for nil:NilClass [Errno 1] (NoMethodError)

Solution

  1. In the Problem Report dialog box, click Diagnose to generate a diagnostic log.

  2. Open the diagnostic log mpaas.log and view the call stack of the script that was running when the error occurred. For example, the following call stack shows that an empty value was found during the search_from_build_phase stage.

    [2020-02-03 12:34:12 +0800][mpaas][INFO](version.rb 63): 
    [2020-02-03 12:34:30 +0800][mpaas][ERROR](entry.rb 37): undefined method `display_name' for nil:NilClass
    [2020-02-03 12:34:30 +0800][mpaas][ERROR](entry.rb 44): [!] undefined method `display_name' for nil:NilClass [Errno 1] (NoMethodError)
    [2020-02-03 12:34:30 +0800][mpaas][ERROR](entry.rb 44): 
     /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'
     /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'
     /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'
     /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'
     /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'
     /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'
     /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'
     /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'
     /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'
     /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='
     /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'
     /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'
     /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'
     /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'
     /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'
     /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'
     /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'
     /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'
     /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'
     /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:91:in `assert'
     /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:127:in `run'
     /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'
     /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:91:in `assert'
     /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/command.rb:127:in `run'
     /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/lib/mpaas/entry.rb:19:in `start'
     /Applications/mPaaSPlugin.app/Contents/Resources/bundle/lib/ruby/gems/2.4.0/gems/mpaas-5.0.8/bin/mpaas:11:in `<top (required)>'
     /Applications/mPaaSPlugin.app/Contents/Resources/bundle/bin/mpaas:23:in `load'
     /Applications/mPaaSPlugin.app/Contents/Resources/bundle/bin/mpaas:23:in `<main>'
    [2020-02-03 12:35:04 +0800][mpaas][DEBUG](command.rb 166): Current command: diagnose report -o /Users/donglei/Library/Logs/com.mpaas.MPaaSIDEPlugin --verbose
    [2020-02-03 12:35:04 +0800][mpaas][DEBUG](command.rb 167): ------------------------------
    [2020-02-03 12:35:04 +0800][mpaas][INFO](ui_logger.rb 141): >>> Checking environment
    [2020-02-03 12:35:04 +0800][mpaas][INFO](report.rb 32): -- General --
  3. Open the original project in Xcode and check the settings in Build Phase. In this example, an empty reference exists: build phase

  4. Delete the empty reference. Then, open the project again with the mPaaS Extension.