Search code examples
parsingsdkrubymotion

Parse & Rubymotion


I cannot get parse to work with rubymotion. I tried using the cocoapod and vendoring the project. I must be missing something trivial. The ideal scenario to me would be to use the pod as opposed to vendoring the project, but I'll use whichever I can manage to get working.

I use pods all the time, so I don't think my cocoapods setup is messing anything up. The runtime error I get with this setup occurs when I try and set my app id and client key with:

Parse.setApplicationId('xxx', clientKey:'yyy')

I get this guy:

app_delegate.rb:6:in `application:didFinishLaunchingWithOptions:': uninitialized constant AppDelegate::Parse (NameError)

I have tried deleting my vendor dir and 'rake clean'ing many times. Here is a new blank project that I created that tries to use Parse as a cocoapod and gives me that error. I'd appreciate it if someone could take a look at that to see if it persists for you.

In the other scenario I added Parse as a vendored project. I also added a couple .dylib's and frameworks. Here is another blank project I created to illustrate this scenario. When I try to run this version, I get the following compile time errors:

Build ./build/iPhoneSimulator-6.0-Development
     Build vendor/Parse.framework
   Compile ./app/app_delegate.rb
    Create ./build/iPhoneSimulator-6.0-Development/test.app
      Link ./build/iPhoneSimulator-6.0-Development/test.app/test
Undefined symbols for architecture i386:
  "_ACAccountTypeIdentifierFacebook", referenced from:
      +[PF_FBSession renewSystemAuthorization] in Parse(PF_FBSession.o)
  "_ACFacebookAppIdKey", referenced from:
      -[PF_FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in Parse(PF_FBSession.o)
  "_ACFacebookAudienceEveryone", referenced from:
      -[PF_FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in Parse(PF_FBSession.o)
  "_ACFacebookAudienceFriends", referenced from:
      -[PF_FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in Parse(PF_FBSession.o)
  "_ACFacebookAudienceKey", referenced from:
      -[PF_FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in Parse(PF_FBSession.o)
  "_ACFacebookAudienceOnlyMe", referenced from:
      -[PF_FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in Parse(PF_FBSession.o)
  "_ACFacebookPermissionsKey", referenced from:
      -[PF_FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in Parse(PF_FBSession.o)
  "_OBJC_CLASS_$_ACAccountStore", referenced from:
      objc-class-ref in Parse(PF_FBSession.o)
  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
      objc-class-ref in Parse(PF_FBSettings.o)
  "_OBJC_CLASS_$_CLLocationManager", referenced from:
      objc-class-ref in Parse(PFLocationManager.o)
  "_OBJC_CLASS_$_SKPayment", referenced from:
      objc-class-ref in Parse(PFPurchase.o)
  "_OBJC_CLASS_$_SKPaymentQueue", referenced from:
      objc-class-ref in Parse(PFPurchase.o)
      objc-class-ref in Parse(PFPaymentTransactionObserver.o)
  "_OBJC_CLASS_$_SKProductsRequest", referenced from:
      objc-class-ref in Parse(PFPurchase.o)
  "_OBJC_CLASS_$_SLComposeViewController", referenced from:
      objc-class-ref in Parse(PF_FBNativeDialogs.o)
  "_SLServiceTypeFacebook", referenced from:
      +[PF_FBNativeDialogs composeViewControllerWithSession:handler:] in Parse(PF_FBNativeDialogs.o)
ld: symbol(s) not found for architecture i386
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:386:in `build'
/Library/RubyMotion/lib/motion/project/app.rb:72:in `build'
/Library/RubyMotion/lib/motion/project.rb:51:in `block (2 levels) in <top (required)>'
/Users/pachun/.rvm/gems/ruby-1.9.3-p327@motion/bin/ruby_noexec_wrapper:14:in `eval'
/Users/pachun/.rvm/gems/ruby-1.9.3-p327@motion/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => default => simulator => build:simulator
(See full trace by running task with --trace)

If someone who's used parse could take a look at those and let me know if they get the same thing/what they think the problem is, I'd really appreciate it. This is holding me up. Thanks,

Pachun


Solution

  • First, there is no Parse CocoaPod.

    Second, the problem with your Rakefile is that you didn't include all of the required libraries. Here's what works for me: https://gist.github.com/4367907