clayallsopp / motion-screenshots

Automatic screenshots for your RubyMotion apps
MIT License
41 stars 2 forks source link

Compatible with RubyMotion 3.6? #7

Open mwise opened 9 years ago

mwise commented 9 years ago

I am trying to use motion-screenshots but can't seem to get it to work. When I run rake screenshots, no screenshots are created and the app blows up when I ctrl-c the terminal window running the simulator. As the setup seems dead simple, I'm a little confused as to what's wrong. I've included the shell output at the bottom of this (long) issue.

I've created a simple repository illustrating the behavior: https://github.com/mwise/motion-screenshots-test

A few things I've noticed:

Objective-C stub for message `actionWithName:asynchronous:actionBlock:cleanupBlock:' type `@@:@c@?@?' not precompiled. Make sure you properly link with the framework or library that defines this message.
→ rake
     Build ./build/iPhoneSimulator-8.1-Development
   Compile /tmp/motion_env_1425783585.rb
      Link ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app/motion-screenshots-test
ld: warning: ignoring file ./build/iPhoneSimulator-8.1-Development/objs/Users/mark/projects/ios/rubymotion/motion-screenshots-test/app/app_screenshots.rb.o, missing required architecture x86_64 in file ./build/iPhoneSimulator-8.1-Development/objs/Users/mark/projects/ios/
rubymotion/motion-screenshots-test/app/app_screenshots.rb.o (1 slices)
ld: warning: ignoring file ./build/iPhoneSimulator-8.1-Development/objs/Users/mark/projects/ios/rubymotion/motion-screenshots-test/app/my_first_view_controller.rb.o, missing required architecture x86_64 in file ./build/iPhoneSimulator-8.1-Development/objs/Users/mark/proj
ects/ios/rubymotion/motion-screenshots-test/app/my_first_view_controller.rb.o (1 slices)
Undefined symbols for architecture x86_64:
  "_MREP_319D6104414D487E945E0E0B9AA9A244", referenced from:
      _RubyMotionInit in init.o
  "_MREP_ABC42A576F184A6D9461F7E47F55A08F", referenced from:
      _RubyMotionInit in init.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
rake aborted!
Command failed with status (1): [/Applications/Xcode.app/Contents/Developer...]
/Library/RubyMotion/lib/motion/project/builder.rb:322:in `build'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-env-0.0.4/lib/motion-env/builder.rb:32:in `build_with_env'
/Library/RubyMotion/lib/motion/project/app.rb:78:in `build'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:53:in `build_with_cocoapods'
/Library/RubyMotion/lib/motion/project/template/ios.rb:68:in `block (2 levels) in <top (required)>'
/Library/RubyMotion/lib/motion/project/template/ios.rb:189:in `block in <top (required)>'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `eval'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => build:simulator
(See full trace by running task with --trace)

So yeah, I'm not really sure what's going on. Have you noticed anything like the what I've described? It seems like there might be a few different issues at play, but I tried to craft the "Hello World" of motion-screenshot implementations. I'm running RubyMotion 3.6, Ruby 2.1.2 on OS X. I'd be happy to try to PR a fix or two if you can point me in the right direction.

Shell output from borked rake screenshots run:

 rake screenshots
  WARNING! Forcing 32bit-only build target for screenshots..
Updating spec repo `master`
Already up-to-date.

CocoaPods 0.36.0.rc.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Analyzing dependencies
Downloading dependencies
Installing KSScreenshotManager (0.0.1)
Generating Pods project
     Build ./build/iPhoneSimulator-8.1-Development
   Compile /Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-screenshots-0.1.1/lib/motion/motion-screenshots.rb
   Compile ./app/my_first_view_controller.rb
   Compile ./app/app_screenshots.rb
   Compile ./app/app_delegate.rb
   Compile /tmp/motion_env_1425783989.rb
    Create ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app
      Link ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app/motion-screenshots-test
    Create ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app/PkgInfo
    Create ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app/Info.plist
      Copy ./resources/Default-568h@2x.png
      Copy ./resources/Default-667h@2x.png
      Copy ./resources/Default-736h@3x.png
    Create ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app.dSYM
  Simulate ./build/iPhoneSimulator-8.1-Development/motion-screenshots-test.app
(main)> rake aborted!
Interrupt: 
/Library/RubyMotion/lib/motion/project/template/ios.rb:235:in `system'
/Library/RubyMotion/lib/motion/project/template/ios.rb:235:in `block in <top (required)>'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-screenshots-0.1.1/lib/motion-screenshots.rb:96:in `block (2 levels) in <top (required)>'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `eval'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => default => simulator
(See full trace by running task with --trace)
Re-installing pods...
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - vendor/Pods/Target Support Files/Pods/Pods-resources.sh
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:305:in `initialize'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:305:in `open'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:305:in `resources'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:238:in `install_resources'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:230:in `install!'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/gems/motion-cocoapods-1.7.0/lib/motion/project/cocoapods.rb:348:in `block (2 levels) in <top (required)>'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `eval'
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => pod:install
(See full trace by running task with --trace)
/Users/mark/.rvm/gems/ruby-2.1.2@motion-screenshots-test/bin/ruby_executable_hooks: Interrupt
clayallsopp commented 9 years ago

Thanks for uploading the example project, that helps with debugging. I couldn't get it to work either - looks like some of the internal RubyMotion/CocoaPods behavior this used changed with RubyMotion 3

I don't have more time to fix it unfortunately =\ there are probably other projects which do this (either for RubyMotion or generic CocoaPods - maybe https://github.com/terriblelabs/motion-juxtapose would work?), and I'd be happy to merge any PRs that fix it