简体   繁体   English

解析应用无法在实际设备上运行“ clang:错误:链接器命令失败,退出代码为1” Swift 2.0 Xcode 7 beta 6

[英]Parse app not working on real device “clang: error: linker command failed with exit code 1” Swift 2.0 Xcode 7 beta 6

I have downloaded the parse core quick start swift Xcode project. 我已经下载了解析核心快速入门swift Xcode项目。 It runs perfectly fine in the simulator: I can create users, upload data, etc... But when I try to run it on my physical device I get this error in Xcode: clang: error: linker command failed with exit code 1 (use -v to see invocation) I am sure that I have all the needed library's because the project is strait from parse.com. 它在模拟器中运行得非常好:我可以创建用户,上传数据等...但是当我尝试在物理设备上运行它时,我在Xcode中收到此错误: clang: error: linker command failed with exit code 1 (use -v to see invocation)我确定我拥有所有需要的库,因为该项目来自parse.com。 FWI I'm on Swift 2 Xcode 7 beta 6. I don't think that it's an error in the code but here is my app delegate: FWI我正在使用Swift 2 Xcode 7 beta6。我不认为这是代码错误,但这是我的应用程序委托:

import UIKit
import Bolts
import Parse

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        Parse.enableLocalDatastore()
        Parse.setApplicationId("XXXXXXXXXXXXXXXXXXXXXXXXXX",
            clientKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
        PFUser.enableAutomaticUser()

        let defaultACL = PFACL();
        defaultACL.setPublicReadAccess(true)
        PFACL.setDefaultACL(defaultACL, withAccessForCurrentUser:true)

        return true
    }

    func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
        let installation = PFInstallation.currentInstallation()
        installation.setDeviceTokenFromData(deviceToken)
        installation.saveInBackground()

        PFPush.subscribeToChannelInBackground("") { (succeeded: Bool, error: NSError?) in
            if succeeded {
                print("good");
            } else {
                print("bad", error)
            }
        }
    }

    func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
        if error.code == 3010 {
            print("Push notifications are not supported in the iOS Simulator.")
        } else {
            print("application:didFailToRegisterForRemoteNotificationsWithError: %@", error)
        }
    }

    func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
        PFPush.handlePush(userInfo)
        if application.applicationState == UIApplicationState.Inactive {
            PFAnalytics.trackAppOpenedWithRemoteNotificationPayload(userInfo)
        }
    }
}

And my ViewController.swift: 还有我的ViewController.swift:

import UIKit
import Parse

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        let testObject = PFObject(className: "TestObject")
        testObject["foo"] = "bar"
        testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
            print("Object has been saved.")
        }
    }
}

See if deleting your derived data folder fixes it. 查看删除衍生数据文件夹是否可以解决该问题。

Also, you may want to change your Parse keys, since you just posted them on StackOverflow. 另外,由于您刚刚将它们发布在StackOverflow上,因此您可能想要更改其解析键。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 叮当:错误:链接器命令失败,退出代码为1(使用-v查看调用)Xcode 10,Xcode 10.1 Beta,Swift 4.2 - Clang: error: linker command failed with exit code 1 (use -v to see invocation) Xcode 10, Xcode 10.1 Beta, Swift 4.2 铛:错误:链接器命令失败,退出代码为1,Xcode链接器错误 - clang: error: linker command failed with exit code 1, Xcode Linker Error Xcode 10 beta错误:链接器命令失败,退出代码为1 - Xcode 10 beta error: linker command failed with exit code 1 Unity,Xcode和Clang:错误:链接器命令失败,退出代码为1 - Unity, Xcode and clang: error: linker command failed with exit code 1 铛:错误:链接器命令失败,退出代码1仅在设备上出现 - clang: error: linker command failed with exit code 1 coming only on device 链接器命令失败,退出代码1 clang:错误 - linker command failed with exit code 1 clang:error ios swift 应用程序编译错误:链接器命令失败,退出代码为 1 - ios swift app compilation error: linker command failed with exit code 1 xcode中的错误:clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) - error in xcode : clang: error: linker command failed with exit code 1 (use -v to see invocation) Swift:错误:链接器命令失败,退出代码为1 - Swift: error: linker command failed with exit code 1 如何解决Xcode 10 Beta中的错误“链接器命令失败,退出代码1(使用-v查看调用)”? - How to solve an error “linker command failed with exit code 1 (use -v to see invocation) ”in Xcode 10 beta?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM