jamonholmgren / ProMotion

ProMotion is a RubyMotion gem that makes iPhone development less like Objective-C and more like Ruby.
MIT License
1.26k stars 147 forks source link

uninitialized constant ProMotion::UITabBarController (NameError) #815

Closed rstammer closed 5 years ago

rstammer commented 5 years ago

Hi πŸ‘‹

While following the README example (using the ProMotion v2.8.2) I am not able to compile/run the application using rake. The process crashes ending up with

cocoatouch/tab_bar_controller.: uninitialized constant ProMotion::UITabBarController (NameError)

I am using Ruby v2.5.0 on macOS v10.13.6 and ProMotion v2.8.2. You can inspect my full example application here on GitHub.

I'd appreciate any hints or help 🌻

Here's the full error log:

==========================================================================================
WARNING: Using offline templates. Run `motion repo` to download the latest templates.
==========================================================================================
Ignoring bcrypt-3.1.11 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.11
Ignoring bindex-0.5.0 because its extensions are not built.  Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.0 because its extensions are not built.  Try: gem pristine bootsnap --version 1.3.0
Ignoring byebug-10.0.2 because its extensions are not built.  Try: gem pristine byebug --version 10.0.2
Ignoring byebug-10.0.1 because its extensions are not built.  Try: gem pristine byebug --version 10.0.1
Ignoring byebug-9.0.6 because its extensions are not built.  Try: gem pristine byebug --version 9.0.6
Ignoring debug_inspector-0.0.2 because its extensions are not built.  Try: gem pristine debug_inspector --version 0.0.2
==========================================================================================
WARNING: Using offline templates. Run `motion repo` to download the latest templates.
==========================================================================================
     Build ./build/MacOSX-10.13-Development
  WARNING! Possible cyclical dependency between /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/collection/data/collection_data.rb and /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/collection/collection.rb's class hierarchy. Consider revision if runtime exceptions occur around undefined symbols.
  WARNING! Possible cyclical dependency between /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/data/table_data.rb and /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/table.rb's class hierarchy. Consider revision if runtime exceptions occur around undefined symbols.
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/motion_print-1.2.0/lib/../motion/motion_print/core_ext/kernel.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/motion_print-1.2.0/lib/../motion/motion_print/version.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/motion_print-1.2.0/lib/../motion/motion_print/core_ext/string.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/motion_print-1.2.0/lib/../motion/motion_print/colorizer.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/stubs/dummy_image_view.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/tab_bar_controller.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/motion_print-1.2.0/lib/../motion/motion_print/motion_print.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/tabs/tabs.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/navigation_controller.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/styling/styling.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/collection_view_controller.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/stubs/dummy_view.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/split_view_controller.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/support/support.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/screen/nav_bar_module.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/collection/cell/collection_view_cell_module.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/screen/screen_navigation.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/screen/status_bar_module.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/collection_view_cell.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/ipad/split_screen.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/collection/data/collection_data.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/collection/collection_class_methods.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/screen/screen_module.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/collection/collection_builder.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/view_controller.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/collection/collection_screen.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/collection/collection.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/web/web_screen_module.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/ns_url.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/table_view_cell.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/table_utils.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/logger/logger.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/repl/live_reloader.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/collection/data/collection_data_builder.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/delegate/delegate_module.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/cell/table_view_cell_module.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/ns_string.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/delegate/delegate.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/table_class_methods.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/table_view_controller.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/extensions/searchable.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/web/web_screen.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/extensions/indexable.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/repl/repl.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/delegate/delegate_parent.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/table.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/table_screen.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/table_builder.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/pro_motion.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/screen/screen.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/extensions/longpressable.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/extensions/refreshable.rb
   Compile ./app/app_delegate.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/data/table_data.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/data/table_data_builder.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/grouped_table.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/version.rb
   Compile ./app/screens/help_screen.rb
   Compile /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/table/grouped_table_screen.rb
   Compile ./app/menu.rb
   Compile ./app/screens/root_screen.rb
    Create ./build/MacOSX-10.13-Development/monkeys_and_pirates.app/Contents
    Create ./build/MacOSX-10.13-Development/monkeys_and_pirates.app/Contents/MacOS
      Link ./build/MacOSX-10.13-Development/monkeys_and_pirates.app/Contents/MacOS/monkeys_and_pirates
    Create ./build/MacOSX-10.13-Development/monkeys_and_pirates.app/Contents/PkgInfo
    Create ./build/MacOSX-10.13-Development/monkeys_and_pirates.app/Contents/Info.plist
      Copy ./resources/Credits.rtf
    Create ./build/MacOSX-10.13-Development/monkeys_and_pirates.app.dSYM
      Copy ./build/MacOSX-10.13-Development/monkeys_and_pirates.app.dSYM
       Run ./build/MacOSX-10.13-Development/monkeys_and_pirates.app/Contents/MacOS/monkeys_and_pirates
2018-12-03 17:29:45.668 monkeys_and_pirates[73237:789319] /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/tab_bar_controller.: uninitialized constant ProMotion::UITabBarController (NameError)
    from /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/tab_bar_controller.
2018-12-03 17:29:45.670 monkeys_and_pirates[73237:789319] *** Terminating app due to uncaught exception 'NameError', reason: '/Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/tab_bar_controller.: uninitialized constant ProMotion::UITabBarController (NameError)
    from /Users/robin/.rvm/gems/ruby-2.5.0/gems/ProMotion-2.8.2/lib/ProMotion/cocoatouch/tab_bar_controller.
'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff37ef423b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00007fff5f177c76 objc_exception_throw + 48
    2   monkeys_and_pirates                 0x00000001002944f0 _ZL10__vm_raisev + 336
    3   monkeys_and_pirates                 0x0000000100294580 rb_vm_raise + 80
    4   monkeys_and_pirates                 0x000000010019fd69 rb_exc_raise + 9
    5   monkeys_and_pirates                 0x000000010019a218 rb_name_error + 216
    6   monkeys_and_pirates                 0x0000000100253020 rb_mod_const_missing + 80
    7   monkeys_and_pirates                 0x000000010027a5cc rb_vm_dispatch + 5564
    8   monkeys_and_pirates                 0x0000000100253ebc rb_const_get_0 + 1084
    9   monkeys_and_pirates                 0x000000010001ac3d vm_get_const + 269
    10  monkeys_and_pirates                 0x000000010001e3e8 rb_scope2 + 56
    11  monkeys_and_pirates                 0x000000010001e35b rb_scope1 + 123
    12  monkeys_and_pirates                 0x00000001000220eb MREP_57E22BD4157B407DB7A8B37C37FF2B7C + 2779
    13  monkeys_and_pirates                 0x0000000100001bbc RubyMotionInit + 204
    14  monkeys_and_pirates                 0x0000000100001f0b main + 107
    15  libdyld.dylib                       0x00007fff5fd91015 start + 1
    16  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NameError
rstammer commented 5 years ago

I've also tested this against Ruby 2.3.4, 2.4.0 and with ProMotion v2.7.1, which all results in the same problem. And I forgot to mentiomn using RubyMotion v5.16. Could be also the case that this issue is in fact a problem of the underlying RubyMotion (?) πŸ€”

markrickert commented 5 years ago

@neumanrq Can you try this branch and let me know if it works? https://github.com/infinitered/ProMotion/tree/bugfix/issue-810

Use this in your gemfile:

gem 'ProMotion', github: 'infinitered/ProMotion', branch: 'bugfix/issue-810'

andrewhavens commented 5 years ago

@neumanrq I took a quick look at your example app and I just realized you're trying to build a desktop Mac app using ProMotion. I think ProMotion is only set up to be used for building iOS apps at the moment. So I think the error that you're getting is related to missing iOS specific constants.

andrewhavens commented 5 years ago

@neumanrq You might be interested in checking out WhitePotion which is a work in progress but designed for building Mac apps.

markrickert commented 5 years ago

Doh! #faceplam. I didn't even catch that.

rstammer commented 5 years ago

Oh, of course πŸ™ˆ You're completely right. Thanks for your help and sharing your work. And sorry for the confusion created.