【问题标题】:Why is my build failing when using parse framework with Swift?为什么我的构建在使用 Swift 解析框架时会失败?
【发布时间】:2014-11-24 04:21:08
【问题描述】:

Bridging-Header.h

#import <Parse/Parse.h>

AppDelegate.swift

class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    func application(application: UIApplication,
                       didFinishLaunchingWithOptions launchOptions:
                       [NSObject: AnyObject]?) -> Bool {
        Parse.setApplicationId(
            "---",
            clientKey: "---"
        )
        return true
    }
    func applicationWillResignActive(application: UIApplication) {
        // Sent when the application is about to move from active to inactive
        //   state. This can occur for certain types of temporary interruptions
        //   (such as an incoming phone call or SMS message) or when the user
        //   quits the application and it begins the transition to the 
        //   background state.
        // Use this method to pause ongoing tasks, disable timers, and throttle
        //   down OpenGL ES frame rates. Games should use this method to pause
        //   the game.
    }
    func applicationDidEnterBackground(application: UIApplication) {
        // Use this method to release shared resources, save user data,
        //   invalidate timers, and store enough application state information
        //   to restore your application to its current state in case it is
        //   terminated later.
        // If your application supports background execution, this method is
        //   called instead of applicationWillTerminate: when the user quits.
    }
    func applicationWillEnterForeground(application: UIApplication) {
        // Called as part of the transition from the background to the inactive
        //   state; here you can undo many of the changes made on entering the
        //   background.
    }
    func applicationDidBecomeActive(application: UIApplication) {
        // Restart any tasks that were paused (or not yet started) while the
        //   application was inactive. If the application was previously in the
        //   background, optionally refresh the user interface.
    }
    func applicationWillTerminate(application: UIApplication) {
        // Called when the application is about to terminate. Save data if
        //   appropriate. See also applicationDidEnterBackground:.
    }
}

我收到 4 个匹配 O 链接错误。

我与库部分的链接二进制文件:

AudioToolbox

CFNetwork

CoreGraphics

CoreLocation

libz.dylib

MobileCoreServices

Parse

QuartzCore

Security

StoreKit

SystemConfiguration

错误:

Ld /Users/randyschriefer/Library/Developer/Xcode/DerivedData/my-chore-v1-fzgmcywcibhivvbfxickdtpycest/Build/Products/Debug-iphoneos/my-chore-v1.app/my-chore-v1 normal armv7
    cd /Users/randyschriefer/Desktop/Maddie/iOS/my-chore-v1
    export IPHONEOS_DEPLOYMENT_TARGET=7.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -L/Users/randyschriefer/Library/Developer/Xcode/DerivedData/my-chore-v1-fzgmcywcibhivvbfxickdtpycest/Build/Products/Debug-iphoneos -F/Users/randyschriefer/Library/Developer/Xcode/DerivedData/my-chore-v1-fzgmcywcibhivvbfxickdtpycest/Build/Products/Debug-iphoneos -F/Users/randyschriefer/Desktop/Maddie/iOS/my-chore-v1 -filelist /Users/randyschriefer/Library/Developer/Xcode/DerivedData/my-chore-v1-fzgmcywcibhivvbfxickdtpycest/Build/Intermediates/my-chore-v1.build/Debug-iphoneos/my-chore-v1.build/Objects-normal/armv7/my-chore-v1.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -force_load -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a -Xlinker -add_ast_path -Xlinker /Users/randyschriefer/Library/Developer/Xcode/DerivedData/my-chore-v1-fzgmcywcibhivvbfxickdtpycest/Build/Intermediates/my-chore-v1.build/Debug-iphoneos/my-chore-v1.build/Objects-normal/armv7/my_chore_v1.swiftmodule -miphoneos-version-min=7.1 -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreLocation -lz -framework MobileCoreServices -framework Parse -framework QuartzCore -framework Security -framework StoreKit -framework SystemConfiguration -Xlinker -dependency_info -Xlinker /Users/randyschriefer/Library/Developer/Xcode/DerivedData/my-chore-v1-fzgmcywcibhivvbfxickdtpycest/Build/Intermediates/my-chore-v1.build/Debug-iphoneos/my-chore-v1.build/Objects-normal/armv7/my-chore-v1_dependency_info.dat -o /Users/randyschriefer/Library/Developer/Xcode/DerivedData/my-chore-v1-fzgmcywcibhivvbfxickdtpycest/Build/Products/Debug-iphoneos/my-chore-v1.app/my-chore-v1

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_BFExecutor", referenced from:
      objc-class-ref in Parse(PFUser.o)
      objc-class-ref in Parse(BFTask+Private.o)
      l_OBJC_$_CATEGORY_BFExecutor_$_Background in Parse(BFTask+Private.o)
  "_OBJC_CLASS_$_BFTask", referenced from:
      objc-class-ref in Parse(PFUser.o)
      objc-class-ref in Parse(PFFile.o)
      objc-class-ref in Parse(PFNetworkCommandRunner.o)
      objc-class-ref in Parse(PFObject.o)
      objc-class-ref in Parse(PFPush.o)
      objc-class-ref in Parse(PFRetryingCommandRunner.o)
      l_OBJC_$_CATEGORY_BFTask_$_Private in Parse(BFTask+Private.o)
      ...
  "_OBJC_CLASS_$_BFTaskCompletionSource", referenced from:
      objc-class-ref in Parse(PFCommandCache.o)
      objc-class-ref in Parse(PFNetworkCommandRunner.o)
      objc-class-ref in Parse(PFObject.o)
      objc-class-ref in Parse(BFTask+Private.o)
      objc-class-ref in Parse(PFTaskHTTPRequestOperation.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

  • 无视。只需添加 bolts.framework。
  • 回答你自己的问题是可以的,因为其他人会从中受益更多。请发布您的答案,一旦超时,您可以将您的答案标记为正确。

标签: ios swift parse-platform xcode6.1


【解决方案1】:

我只需要添加 bolts.framework

【讨论】:

    【解决方案2】:

    除了这些框架之外,从您的项目中添加 MobileCoreServices.framework

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-29
      • 2013-07-04
      • 2018-09-02
      • 1970-01-01
      相关资源
      最近更新 更多