Tapstream with RubyMotion

269 views
Skip to first unread message

Websembly

unread,
Jul 18, 2012, 9:10:58 PM7/18/12
to rubym...@googlegroups.com
Has anyone tried (and succeeded) Tapstream with RubyMotion?
I am having difficulty with the small external library.   The "app.vendor_project 'vendor'/code, :static" trick mentioned in other threads on external libraries is not working for me.

I appreciate any guidance/help/reprimand/comment/criticism/complaint/expletive that might get me on track.
 

Francis Chong

unread,
Jul 19, 2012, 2:04:43 AM7/19/12
to rubym...@googlegroups.com
Hi

it seems tapstream is deployed using "Framework". Framework is a collection of static library, headers and resources. To use in rubymotion you would have to do following:

    app.vendor_project('vendor/Tapstream.framework', :static,
       
:products => ['Tapstream'],
       
:headers_dir => 'Headers')

You may have to tweak the details, but it should give you the idea.

Websembly

unread,
Jul 19, 2012, 6:43:51 PM7/19/12
to rubym...@googlegroups.com
Fantastic.
Thanks Francis.

Websembly

unread,
Jul 20, 2012, 9:54:45 AM7/20/12
to rubym...@googlegroups.com
I am still having some trouble with this and would appreciate any guidance you can offer.

I have the 'Tapstream.Framework'  package in a directory 'vendor' under my project directory (a peer to 'app' and 'resources', et cetera).
In my Rakefile I have added this (as Francis suggested)
    app.vendor_project('vendor/Tapstream.framework', :static,
        :products => ['Tapstream'],
        :headers_dir => 'Versions/A/Headers')
    app.frameworks += ['Tapstream']

In the app_delegate.rb I have this line (but it is currently remarked out, so not the cause of the error)
    Tapstream.setAccountName:"<ACCOUNT_NAME_REMOVED>", developerSecret:"<SECRET_REMOVED_FOR_PRIVACY>"

A Rake fails with this error message:
     Build ./build/iPhoneSimulator-5.0-Development
     Build vendor/Tapstream.framework
/usr/bin/gen_bridge_metadata:59:in `basename': can't convert nil into String (TypeError)
from /usr/bin/gen_bridge_metadata:59
rake aborted!
Command failed with status (1): [RUBYOPT='' /usr/bin/gen_bridge_metadata --...]

ATdhvaannkcse,
Thom

On Thursday, July 19, 2012 2:04:43 AM UTC-4, Francis Chong wrote:

Francis Chong

unread,
Jul 21, 2012, 12:00:55 AM7/21/12
to rubym...@googlegroups.com
I just tried following:

Rakefile
```
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'

Motion::Project::App.setup do |app|
  # Use `rake config' to see complete project settings.
  app.name = 'TapstreamSample'
  app.vendor_project('vendor/Tapstream.framework', :static,
        :products => ['Tapstream'],
        :headers_dir => 'Headers')
end
```

app_delegate.rb
```
class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    Tapstream.shared.setAccountName("TAPSTREAM_ACCOUNT_NAME", developerSecret:"DEV_SECRET_KEY")
    Tapstream.shared.fireEvent("activation")
    true
  end
end
```

and it seems working. try to rake clean to clean the built, and run rake again.

Websembly

unread,
Jul 21, 2012, 7:44:40 PM7/21/12
to rubym...@googlegroups.com
Thanks, as always, for your help.
I replicated exactly what you have here and get the following error/ouput:


     
Build ./build/iPhoneSimulator-5.0-Development
     
Build vendor/Tapstream.framework
/usr/bin/gen_bridge_metadata:59:in
`basename': can't convert nil into String (TypeError)

 from /usr/bin/gen_bridge_metadata:59
rake aborted!
Command failed with status (1): [RUBYOPT='' /usr/bin/gen_bridge_metadata --...]


Tasks: TOP => default => simulator => build:simulator



What version of RubyMotion are you using?   I am on RubyMotion version 1.19
It has been difficult to keep up with the constant flow of updates!!

Thom

Francis Chong

unread,
Jul 21, 2012, 9:14:42 PM7/21/12
to rubym...@googlegroups.com
I'm using same version! weird, perhaps you should report the issue.

Websembly

unread,
Jul 21, 2012, 10:14:38 PM7/21/12
to rubym...@googlegroups.com
Thanks again Francis

I am hoping someone else reading this - ATTENTION LAURENT - has some insight into the details of the "gen_bridge_metadata"

I have tracked this down to this:
   The error points directly to line 59 in /usr/bin/gen_bridge_metadata
   That line is apparently getting a nil where it expects a string.  I suspect the File.basename(CPP) is the cause.
56  class OCHeaderAnalyzer
57      CPP = ['/usr/bin/cpp-4.2', '/usr/bin/cpp-4.0', '/usr/bin/cpp'].find { |x| File.exist?(x) }
58      CPPFLAGS = "-D__APPLE_CPP__ -include /usr/include/AvailabilityMacros.h"
59      CPPFLAGS << " -D__GNUC__" unless /^cpp-4/.match(File.basename(CPP))



I have tried hacking at this file, just to get some idea but, apparently, there is something missing on my system.

I appreciate any help.

Websembly

unread,
Jul 22, 2012, 9:42:16 AM7/22/12
to rubym...@googlegroups.com
I have tracked this down, but would greatly appreciate an explanation.  I believe it centers around the motion installation.

The cause of my problem is that CPP is nil  And that is a result of the call on line 57 (see previous post)

For me the 'cpp-*' files are located (based on the result of a `find` command);
/Developer/usr/bin/cpp
/Developer/usr/bin/cpp-4.2

I modified my copy of `gen_bridge_metadata`, on line 57, as follows:
    CPP = ['/Developer/usr/bin/cpp-4.2', '/Developer/usr/bin/cpp-4.0', '/Developer/usr/bin/cpp'].find { |x| File.exist?(x) }
And it works for me.  But, I suspect, there is a reason those files are not in the expected location on my system.
Maybe this is a bug.  Perhaps there is an important step in installation that I ignored/overlooked and it should be more clearly defined.

In the hopes that my exploration can help someone else (and because I may not remember to modify it again when I upgrade next) I have added a note in the RubyMotion Wiki on this.

Robin Campbell

unread,
Jul 23, 2012, 5:09:15 PM7/23/12
to rubym...@googlegroups.com
Websembly, we'd be happy to give you a hand with this. Send us an email to support[at]tapstream[dot]com and our dev team will jump in.

Robin from Tapstream

Websembly

unread,
Jul 23, 2012, 6:34:30 PM7/23/12
to rubym...@googlegroups.com
Thanks Robin.
As a matter of fact, I *did* send a support ticket and received a very quick response.
That response, however, was to re-iterate what I was already doing.

If you look at my last response, I found the problem(https://github.com/ParkinT/RubyMotion_Life/wiki/Tapstream) and have a work-around, but do not *really* have a resolution.

Thanks,
Thom

veera

unread,
Oct 25, 2012, 8:07:44 AM10/25/12
to rubym...@googlegroups.com
Hi all,

I m trying to add Sharekit in my app, 

In rakefile

require 'rubygems'
require 'motion-cocoapods'

 app.pods do
     pod 'ShareKit/Facebook'
     pod 'ShareKit/Twitter'
   end 

but i m getting this following error


CompileC build/Pods.build/Release-iphonesimulator/Pods.build/Objects-normal/i386/Reachability.o Reachability/Reachability.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler(1 failure)


 ERROR! Building vendor project `vendor/Pods' failed to create at least one `.a' library.

Reply all
Reply to author
Forward
0 new messages