使用带有Rubymotion的Facebook SDK:ld:未找到架构armv7的符号

时间:2013-07-05 21:02:57

标签: facebook-ios-sdk rubymotion cocoapods

当我尝试构建我的Rubymotion应用程序时出现以下错误:

Undefined symbols for architecture armv7:
  "_sqlite3_bind_double", referenced from:
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libPods.a(FBCacheIndex.o)
  "_sqlite3_bind_int", referenced from:
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _trimDatabase] in libPods.a(FBCacheIndex.o)
  "_sqlite3_bind_text", referenced from:
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _readEntryFromDatabase:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _readEntriesFromDatabase:excludingFragment:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _removeEntryFromDatabaseForKey:] in libPods.a(FBCacheIndex.o)
  "_sqlite3_close", referenced from:
      ___23-[FBCacheIndex dealloc]_block_invoke in libPods.a(FBCacheIndex.o)
  "_sqlite3_column_double", referenced from:
      -[FBCacheIndex _createCacheEntityInfo:] in libPods.a(FBCacheIndex.o)
  "_sqlite3_column_int", referenced from:
      -[FBCacheIndex _createCacheEntityInfo:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _fetchCurrentDiskUsage] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _trimDatabase] in libPods.a(FBCacheIndex.o)
  "_sqlite3_column_text", referenced from:
      -[FBCacheIndex _createCacheEntityInfo:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _trimDatabase] in libPods.a(FBCacheIndex.o)
  "_sqlite3_errmsg", referenced from:
      _releaseStatement in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libPods.a(FBCacheIndex.o)
      _initializeStatement in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _readEntryFromDatabase:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _readEntriesFromDatabase:excludingFragment:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _fetchCurrentDiskUsage] in libPods.a(FBCacheIndex.o)
      ...
  "_sqlite3_exec", referenced from:
      ___36-[FBCacheIndex initWithCacheFolder:]_block_invoke in libPods.a(FBCacheIndex.o)
  "_sqlite3_finalize", referenced from:
      _releaseStatement in libPods.a(FBCacheIndex.o)
  "_sqlite3_open_v2", referenced from:
      ___36-[FBCacheIndex initWithCacheFolder:]_block_invoke in libPods.a(FBCacheIndex.o)
  "_sqlite3_prepare_v2", referenced from:
      _initializeStatement in libPods.a(FBCacheIndex.o)
  "_sqlite3_reset", referenced from:
      _initializeStatement in libPods.a(FBCacheIndex.o)
  "_sqlite3_step", referenced from:
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _createCacheEntityInfo:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _fetchCurrentDiskUsage] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _removeEntryFromDatabaseForKey:] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _dropTrimmingTable] in libPods.a(FBCacheIndex.o)
      -[FBCacheIndex _trimDatabase] in libPods.a(FBCacheIndex.o)
      ...
ld: symbol(s) not found for architecture armv7
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...]

Tasks: TOP => archive => build:device
(See full trace by running task with --trace)

我的Rakefile

$:.unshift("/Library/RubyMotion/lib")

require File.join(File.dirname(__FILE__), 'version')

require 'motion/project/template/ios'

require 'bundler'

Bundler.require

Motion::Project::App.setup do |app|
  app.name                   = "myapp"
  app.seed_id                = "79HA123AYV"
  app.identifier             = "com.myapp.MyApp"  
  app.prerendered_icon       = false
  app.deployment_target      = "5.0"
  app.sdk_version            = "6.1"
  app.detect_dependencies    = false
  app.device_family          = :iphone
  app.interface_orientations = [:portrait]

  app.entitlements['application-identifier'] = "#{app.seed_id}.#{app.identifier}"
  app.entitlements['keychain-access-groups'] = ["#{app.seed_id}.#{app.identifier}"]  

  app.development do
    app.codesign_certificate   = "iPhone Developer: Gavin Morrice (KT54265K2S)"
    app.provisioning_profile   = '/Users/Gavin/Library/MobileDevice/Provisioning Profiles/01EDFC67-2B0F-4BEC-99E5-9A0446B00680.mobileprovision'
    app.entitlements['aps-environment']        = 'development'
    app.entitlements['get-task-allow']         = true
  end

  app.release do
    app.codesign_certificate   = "iPhone Distribution: MyApp Inc."
    app.provisioning_profile   = '/Users/Gavin/Library/MobileDevice/Provisioning Profiles/017F2EC9-CA51-4866-8AD9-7FDF764F9658.mobileprovision'
    app.entitlements['aps-environment']        = 'production'
    app.entitlements['get-task-allow']         = false
  end

  app.frameworks    = ["UIKit", "Foundation", "CoreGraphics", 'CoreLocation', 'MapKit', 'QuartzCore', 'AdSupport', 'Accounts', 'Social']
  app.weak_frameworks += %w{ AdSupport Accounts Social }

  app.icons         = ['Icon.png', 'Icon@2x.png', 'Icon-72.png']

  app.short_version = VERSION
  app.version       = VERSION

  app.vendor_project('vendor/CrittercismSDK', :static, headers_dir: 'vendor/CrittercismSDK')  
  app.vendor_project('vendor/Reachability', :static, headers_dir: 'vendor/Reachability')  
  app.vendor_project('vendor/FPPopover', :static, headers_dir: 'vendor/FPPopover')  

  app.pods do
    pod 'AFNetworking', '~> 0.10.1' # Can't update to 1.0.0 - it doesn't support iOS 4.3
    pod 'Facebook-iOS-SDK', '>= 3.5.3'
    pod 'MBProgressHUD', '~> 0.5'
    pod 'PullToRefresh', '~> 0.0.1'
  end

  # TestFlight
  app.testflight.sdk        = 'vendor/TestFlightSDK'
  app.testflight.api_token  = '7303366cf2392c9982e9e3f3dd8bdeee_MIz2MzU3MjAxMi0wMi0yMSAwOToyMjozOC43NjkwMDM'
  app.testflight.team_token = '85cc97e933d2ab89ad0ee822053c4a98Q_Nj0NDMyMDEyLTAyLTIxIDA5OjQyOjIyLjgzMjg3OQ'  
  # app.testflight.notify     = true # default is false    

  # Facebook
  app.info_plist['FacebookAppID'] = '45104091231578962'
  app.info_plist['URL types'] = { 'URL Schemes' => 'fb451040691578962'}
end

任何人都可以提供建议吗?感谢

2 个答案:

答案 0 :(得分:1)

将以下内容添加到框架正上方的Rakefile中:

app.libs << '/usr/lib/libz.1.1.3.dylib'
app.libs << '/usr/lib/libsqlite3.dylib'

您可能需要根据特定配置调整路径或版本。

答案 1 :(得分:0)

看起来Facebook SDK需要sqlite。将-lsqlite3添加到app.frameworks应该可以解决此问题。