Search code examples
iosparse-platformrubymotion

RubyMotion Parse.com error


I hope someone here can help me. I've added the Parse.framework to my vendor vendor and have the following inside my rakefile:

# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require "rubygems"
require 'bundler'
require 'bubble-wrap/location'
Bundler.require

Motion::Project::App.setup do |app|
  app.name = 'myapp'

  app.libs << '/usr/lib/libz.1.1.3.dylib'
  app.libs << '/usr/lib/libsqlite3.dylib'
  app.frameworks += [
    'AudioToolbox',
    'Accounts',
    'AdSupport',
    'CFNetwork',
    'CoreGraphics',
    'CoreLocation',
    'MobileCoreServices',
    'QuartzCore',
    'Security',
    'Social',
    'StoreKit',
    'SystemConfiguration']

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

When I rake, I get the following error:

  WARNING! BubbleWrap::HTTP is deprecated and will be removed, see https://github.com/rubymotion/BubbleWrap/issues/308
  WARNING! Switch to a different networking library soon - consider AFNetworking: http://afnetworking.com/
  WARNING! You can use the 'bubble-wrap-http' gem if you need compatibility: https://github.com/rubymotion/BubbleWrap-HTTP
     Build ./build/iPhoneSimulator-7.1-Development
     Build /Users/user/.rvm/gems/ruby-2.1.0/gems/cdq-0.1.9/lib/../vendor/cdq/ext
     Build vendor/Parse.framework
      Link ./build/iPhoneSimulator-7.1-Development/myapp.app/myapp
Undefined symbols for architecture i386:
  "_FBTokenInformationExpirationDateKey", referenced from:
      -[PFFacebookTokenCachingStrategy cacheTokenInformation:] in Parse(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy expirationDate] in Parse(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy setExpirationDate:] in Parse(PFFacebookTokenCachingStrategy.o)
  "_FBTokenInformationTokenKey", referenced from:
      -[PFFacebookTokenCachingStrategy accessToken] in Parse(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy setAccessToken:] in Parse(PFFacebookTokenCachingStrategy.o)
  "_FBTokenInformationUserFBIDKey", referenced from:
      -[PFFacebookTokenCachingStrategy facebookId] in Parse(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy setFacebookId:] in Parse(PFFacebookTokenCachingStrategy.o)
  "_OBJC_CLASS_$_FBAppCall", referenced from:
      objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
  "_OBJC_CLASS_$_FBRequest", referenced from:
      objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
  "_OBJC_CLASS_$_FBSession", referenced from:
      objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
  "_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from:
      _OBJC_CLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
  "_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from:
      _OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.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:306:in `build'
/Library/RubyMotion/lib/motion/project/app.rb:78:in `build'
/Users/user/.rvm/gems/ruby-2.1.0/gems/motion-cocoapods-1.5.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:122:in `block in <top (required)>'
/Users/user/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
/Users/user/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => build:simulator
(See full trace by running task with --trace)

It seems to be something related to Facebook? I've installed the Facebook SDK but it didn't make any difference. I've googled parts of the error but without any success. I've tried a ton of different rake configs I've found but none worked. Did I forget to add something specific to my rakefile? Or somewhere else? Thanks!


Solution

  • You should add Facebook SDK into your project. Or, you should add method symbols by refer Parse for iOS: Errors when trying to run the app (https://github.com/Watson1978/HelloParse)