rubymotion-community / Joybox

Cocos2D & Box2D Wrapper for Ruby Motion - Currently out of date an unmaintained :-(
MIT License
280 stars 37 forks source link

Cannot define method `vertices' because no Objective-C stub was pre-compiled for types `^{CGPoint=ff}@:'. Make sure you properly link with the framework or library that defines this message. #68

Open peterseddon opened 10 years ago

peterseddon commented 10 years ago

I'm having the above issue with Joybox when I run rake on a blank template (or any template) I am using rubymotion 2.22. I have tried the following:

gem uninstall joybox -a gem install joybox rm .repl_history rake clean rake

n-studio commented 10 years ago

Same issue here. It works fine with RubyMotion 2.20.

n-studio commented 10 years ago

I filled a ticket to RubyMotion team.

alloy commented 10 years ago

@CurveBeryl Could it be that you have manually fixed the bridgesupport files that you include in the repo? (vendor/**/*.bridgesupport)

alloy commented 10 years ago

To all, what happens is that RubyMotion tries to generate BridgeSupport metadata files in the new build dir location. Before 2.21, this used to be the root of the vendor_project lib dir (e.g. vendor/MyLib), but this would lead to problems when building an app for multiple platforms. Now these are generated in, for instance, vendor/MyLib/build-iPhoneSimulator.

Joybox includes its own metadata files which are different from what the gen_bridge_metadata tool would generate, but these are no longer being used, because RM expects the BridgeSupport file to be in the platform-specific build dir.

We are going to apply a change in RM 2.23 that will pick-up BridgeSupport files in the root of a vendor_project dir or, if non exists, fall back to generating a BridgeSupport file of its own.

For now, what you could do is to patch /Library/RubyMotion/lib/motion/project/vendor.rb:

diff --git a/lib/motion/project/vendor.rb b/lib/motion/project/vendor.rb
index a4416ef..bc9efa9 100644
--- a/lib/motion/project/vendor.rb
+++ b/lib/motion/project/vendor.rb
@@ -131,7 +131,7 @@ EOS
         headers = source_files.select { |p| File.extname(p) == '.h' }
         bs_files = []
         unless headers.empty?
-          bs_file = File.join(build_dir, File.basename(@path) + '.bridgesupport')
+          bs_file = File.basename(@path) + '.bridgesupport'
           if !File.exist?(bs_file) or headers.any? { |h| File.mtime(h) > File.mtime(bs_file) }
             FileUtils.mkdir_p File.dirname(bs_file)
             bs_cflags = (opts.delete(:bridgesupport_cflags) or cflags)
@@ -207,7 +207,7 @@ EOS
         end

         # Generate the bridgesupport file if we need to.
-        bs_file = File.join(build_dir, File.basename(@path) + '.bridgesupport')
+        bs_file = File.basename(@path) + '.bridgesupport'
         headers_dir = opts.delete(:headers_dir)
         if headers_dir
           project_dir = File.expand_path(@config.project_dir)
n-studio commented 10 years ago

Fixed with RubyMotion 2.23