Including a static library, iSpeach SDK

242 views
Skip to first unread message

Richard Smith

unread,
Jul 19, 2012, 6:35:26 AM7/19/12
to rubym...@googlegroups.com

I'm trying to add the a library to my Rubymotion project, it shows no errors but I can't seem to access the classes in the library, in my rakefile I have ...

app.vendor_project('vendor/iSpeechSDK', :static,
    :products => ["libiSpeechSDK.a"],
    :headers_dir => "Headers")

app.frameworks += ['iSpeechSDK']

The .a file and .h files in the Headers directory all exist

In my app_delegate I have this code ...

@sdk = iSpeechSDK.sharedSDK

But I get the error ...

Simulate ./build/iPhoneSimulator-5.0-Development/Mirror Mirror.app (main)> 2012-07-19 10:50:05.978 Mirror Mirror[26195:11903] app_delegate.rb:13:inapplication:didFinishLaunchingWithOptions:': undefined local variable or methodiSpeechSDK' for # (NameError) 2012-07-19 10:50:05.980 Mirror Mirror[26195:11903] * Terminating app due to uncaught exception 'NameError', reason: 'app_delegate.rb:13:inapplication:didFinishLaunchingWithOptions:': undefined local variable or methodiSpeechSDK' for # (NameError) ' * First throw call stack: (0xa88052 0x417d0a 0x207954 0x5c285 0x5bce1)

Laurent Sansonetti

unread,
Jul 19, 2012, 6:45:32 AM7/19/12
to rubym...@googlegroups.com
Hi,

The problem is that the iSpeechSDK class name starts with a lower-case letter, which is not a valid constant name in Ruby.

In the next release you will be able to do ISpeechSDK.sharedSDK (as you can already do to access constants or enumerations that also start with a lower-case letter), but right now, a workaround can be:

    NSClassFromString('iSpeechSDK').sharedSDK

Laurent

Richard Smith

unread,
Jul 19, 2012, 6:55:03 AM7/19/12
to rubym...@googlegroups.com
Thanks Laurent,

I updated the line of code in the app_delegate to ...

@sdk = NSClassFromString('iSpeechSDK').sharedSDK

Now I get this error? ... btw the bundle file, 'iSpeechSDK.bundle' is in the same folder as the libiSpeechSDK.a file so it certainly exists.

Build ./build/iPhoneSimulator-5.0-Development
     Build /Users/creativetechnologist/.rvm/gems/ruby-1.9.2-p290/gems/motion-hpple-0.2.1/vendor/hpple
     Build vendor/iSpeechSDK
     Build vendor/Pods
   Compile ./app/app_delegate.rb
      Link ./build/iPhoneSimulator-5.0-Development/Mirror Mirror.app/Mirror Mirror
    Create ./build/iPhoneSimulator-5.0-Development/Mirror Mirror.dSYM
  Simulate ./build/iPhoneSimulator-5.0-Development/Mirror Mirror.app
2012-07-19 11:52:26.199 Mirror Mirror[27565:11903] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not find 'iSpeechSDK.bundle' within the application bundle. Please make sure you include it.'
*** First throw call stack:
(0xa87052 0x416d0a 0xa2fa78 0xa2f9e9 0x18fb9 0x2f49234 0x2f491fd 0x18eca 0x19bfe 0x2f49234 0x2f491fd 0x19b9b 0x19fe4 0x19efc 0x2f49234 0x2f491fd 0x19eb1 0x510e 0x4fb9 0x2f49234 0x2f491fd 0x4f6e 0x1fb974 0x1f5cdd 0xded4b 0xdef6e 0xe070f 0x12fe9d6 0x12ff8a6 0x130e743 0x130f1f8 0x1302aa9 0x3016fa9 0xa5b1c5 0x9c0022 0x9be90a 0x9bddb4 0x9bdccb 0x12ff2a7 0x1300a9b 0x5b2f0 0x5ad81)
((null))> %          

Laurent Sansonetti

unread,
Jul 19, 2012, 7:34:03 AM7/19/12
to rubym...@googlegroups.com
Perhaps try copying the .bundle file into the resources folder? The build system will not do it automatically (it will only link the app against the .a library). Perhaps we could improve this somehow...

Laurent

Richard Smith

unread,
Jul 19, 2012, 8:52:13 AM7/19/12
to rubym...@googlegroups.com
Perfect, all runs nicely now, thanks for your quick help with this

Stéphane Wirtel

unread,
Jul 19, 2012, 9:12:37 AM7/19/12
to rubym...@googlegroups.com
Hi Richard,

Could you make a small Post with the problem and the solution ?

Thank you,

St�phane
> app_delegate.rb:13:in|application:didFinishLaunchingWithOptions:': undefined local
> variable or method|iSpeechSDK' for # (NameError) 2012-07-19 10:50:05.980 Mirror
> Mirror[26195:11903] ** Terminating app due to uncaught exception 'NameError',
> reason: 'app_delegate.rb:13:in|application:didFinishLaunchingWithOptions:':
> undefined local variable or method|iSpeechSDK' for # (NameError) ' ** First throw
> call stack: (0xa88052 0x417d0a 0x207954 0x5c285 0x5bce1)
>
> --
>
>
>

Richard Smith

unread,
Jul 19, 2012, 9:17:26 AM7/19/12
to rubym...@googlegroups.com, stephan...@gmail.com
No problem at all, will post something later.  I've also got the library to 'speak' now as it should so will add that in too for future reference.

Richard.


On Thursday, July 19, 2012 2:12:37 PM UTC+1, Stéphane Wirtel wrote:
Hi Richard,

Could you make a small Post with the problem and the solution ?

Thank you,

St�phane

Stéphane Wirtel

unread,
Jul 19, 2012, 9:20:54 AM7/19/12
to rubym...@googlegroups.com
Cool, but if you want, you can create a simple gist on github and send the reference in the ml,
because iSpeechSDK can be very useful for everybody.

Regards,

On 07/19/2012 03:17 PM, Richard Smith wrote:
> No problem at all, will post something later. I've also got the library to 'speak' now as it should
> so will add that in too for future reference.
>
> Richard.
>
> On Thursday, July 19, 2012 2:12:37 PM UTC+1, St�phane Wirtel wrote:
>
> Hi Richard,
>
> Could you make a small Post with the problem and the solution ?
>
> Thank you,
>
> St�phane
> --
>
>
>

Richard Smith

unread,
Jul 19, 2012, 9:22:35 AM7/19/12
to rubym...@googlegroups.com
Good plan, will do now.

On 19 Jul 2012, at 14:20, Stéphane Wirtel wrote:

Cool, but if you want, you can create a simple gist on github and send the reference in the ml,
because iSpeechSDK can be very useful for everybody.

Regards,

On 07/19/2012 03:17 PM, Richard Smith wrote:
> No problem at all, will post something later. I've also got the library to 'speak' now as it should
> so will add that in too for future reference.
>
> Richard.
>
> On Thursday, July 19, 2012 2:12:37 PM UTC+1, Stéphane Wirtel wrote:
>
> Hi Richard,
>
> Could you make a small Post with the problem and the solution ?
>
> Thank you,
>
> St�phane
--




Richard Smith

unread,
Jul 19, 2012, 9:45:50 AM7/19/12
to rubym...@googlegroups.com, stephan...@gmail.com
Here is a gist which describes the issues found today along with some code to get the library to 'speak'


On Thursday, July 19, 2012 2:20:54 PM UTC+1, Stéphane Wirtel wrote:
Cool, but if you want, you can create a simple gist on github and send the reference in the ml,
because iSpeechSDK can be very useful for everybody.

Regards,

On 07/19/2012 03:17 PM, Richard Smith wrote:
> No problem at all, will post something later.  I've also got the library to 'speak' now as it should
> so will add that in too for future reference.
>
> Richard.
>
> On Thursday, July 19, 2012 2:12:37 PM UTC+1, St�phane Wirtel wrote:
>
>     Hi Richard,
>
>     Could you make a small Post with the problem and the solution ?
>
>     Thank you,
>
>     St�phane

Suprem SatishReddy

unread,
Jul 19, 2014, 8:14:30 AM7/19/14
to rubym...@googlegroups.com
I am using Ispeech SDK in phonegap application. I dont wont to see.. Loading pop up. Is there any way to not to show it

Colin T.A. Gray

unread,
Jul 19, 2014, 11:56:34 AM7/19/14
to rubym...@googlegroups.com
Suprem: Phonegap?  Sorry, man, I don't think you'll get much help here, this is a RubyMotion forum, and these two systems are WORLDS apart...


Colin T.A. Gray
Community Manager
HipByte




-- 
You received this message because you are subscribed to the Google Groups "RubyMotion - Ruby for iOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubymotion+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubymotion/eebdb37f-6dd0-49fd-b3ec-60b26ecf3788%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages