2015-04-20 15 views
6

Sto cercando di integrare Parse e Facebook di SDK con la mia app utilizzando Xcode 6.3 e sto ottenendo questi errori quando si tenta di costruire:errore di compilazione utilizzando Parse e Facebook Frameworks in Xcode 6.3 (Swift)

Undefined symbols for architecture x86_64: 
    "_OBJC_CLASS_$_FBSDKAppEvents", referenced from: 
     __TMaCSo14FBSDKAppEvents in AppDelegate.o 
    "_OBJC_CLASS_$_FBSDKApplicationDelegate", referenced from: 
     __TMaCSo24FBSDKApplicationDelegate in AppDelegate.o 
    "_OBJC_CLASS_$_PFAnalytics", referenced from: 
     __TMaCSo11PFAnalytics in AppDelegate.o 
    "_OBJC_CLASS_$_PFFacebookUtils", referenced from: 
     __TMaCSo15PFFacebookUtils in AppDelegate.o 
    "_OBJC_CLASS_$_Parse", referenced from: 
     __TMaCSo5Parse in AppDelegate.o 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

I Non so cosa significhi, ma ho provato molte altre soluzioni, come la pulizia, l'eliminazione della cartella dei dati derivati, il controllo di tutti i miei framework e ancora non riesco a risolvere il problema. Se qualcuno ha qualche idea su come risolvere questo problema, sarei molto grato. Grazie per il tuo tempo.

Modifica Questo è il Bridging-header.h che sto usando:

#import <AFNetworking.h> 
#import <BDBOAuth1RequestOperationManager.h> 
#import <NSDictionary+BDBOAuth1Manager.h> 
#import <UIImageView+AFNetworking.h> 
#import <UIScrollView+SVInfiniteScrolling.h> 
#import <FBSDKCoreKit/FBSDKCoreKit.h> 
#import <FBSDKLoginKit/FBSDKLoginKit.h> 
#import <FBSDKShareKit/FBSDKShareKit.h> 
#import <Parse/Parse.h> 
#import <ParseCrashReporting/ParseCrashReporting.h> 
#import <ParseFacebookUtilsV4/PFFacebookUtils.h> 
#import <Bolts/Bolts.h> 

Questo è il file AppDelegate.swift:

import UIKit 
import CoreData 
import Parse 
import FBSDKCoreKit 
import FBSDKLoginKit 
import Bolts 

@UIApplicationMain 
class AppDelegate: UIResponder, UIApplicationDelegate { 

var window: UIWindow? 

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 
    // Override point for customization after application launch. 
    UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true) 

    // Type casting in swift is "as Type", you'll need to unwrap optionals however. 
    let tabBarController = self.window!.rootViewController as! UITabBarController 
    let tabBar = tabBarController.tabBar as UITabBar 

    // I prefer to use 0 based labels since the array is 0 based 
    let tabBarItem0 = tabBar.items![0] as! UITabBarItem 
    let tabBarItem1 = tabBar.items![1] as! UITabBarItem 
    let tabBarItem2 = tabBar.items![2] as! UITabBarItem 

    // The UIColor method you are using is an initializer in swift 
    tabBar.tintColor = UIColor(red: 62.0/255.0, green: 191.0/255.0, blue: 180.0/255.0, alpha: 1.0) 

    // UIImage also has an initializer for your situation in swift 
    tabBarItem0.selectedImage = UIImage(named: "Discover TabBar Select.pdf") 
    tabBarItem1.selectedImage = UIImage(named: "Me TabBar Select.pdf") 
    tabBarItem2.selectedImage = UIImage(named: "Settings TabBar Select.pdf") 

    //Facebook SDK Setup 
    FBSDKApplicationDelegate.sharedInstance() 
    Parse.setApplicationId("HxjVTJZ2rZA6qFBl0Xaji9z12HYQmTFPIXhVcfPp", clientKey:"8FJT7KHSmDPZi1AtpFS1GvTw39qevvB0JuimwWdS") 

    if let launchOptions = launchOptions { 
     PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) 
    } else { 
     PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions([NSObject:AnyObject]()) 
    } 

    // [Optional] Power your app with Local Datastore. For more info, go to 
    // https://parse.com/docs/ios_guide#localdatastore/iOS 
    Parse.enableLocalDatastore() 

    // [Optional] Track statistics around application opens. 
    PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions) 

    return true 
} 

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. 
    FBSDKAppEvents.activateApp() 
} 

ho trascinato l'ultima Parse e Facebook SDK Frameworks nel mio progetto e aggiunto i framework aggiuntivi richiesti (compresi libsqlite3.dylib e libz.dylib) tramite la scheda "Collega binari con librerie" sotto la sezione "Fasi di creazione"

Spero che questa informazione aggiuntiva sia utile.

+0

Potrebbe fornirci il codice che stai cercando di costruire? – MattG

+0

@MattG Ho aggiornato la mia domanda e apprezzo il tuo aiuto – Armin

+0

@Armin hai risolto questo problema? –

risposta

0

Dopo l'aggiornamento alla versione 1.7.4 Parse, questo problema si risolto. Speriamo che questo aiuti altre persone che hanno affrontato lo stesso problema come me!

8

Ho anche affrontato lo stesso problema. In My mine, Facebook sdk 4.1. Questi sono stati i miei passi: -

1) Vai costruire Impostazioni

2) Tipo altre bandiere linker. e dal momento che sto usando l'obiettivo C. così ho cliccato su di esso e aggiungere due nuovi valori. il primo è -ObjC e il secondo è $ (ereditato). Dopo l'aggiunta di questi due valori tue altre bandiere linker sarebbero spettacolo come -ObjC -ObjC - | "pods -...... qualcosa di simile a come sto usando cocapods

3) ora tipo.." Consenti non -modular Include in Framework Modules "e utilizzare il valore YES

4) quindi digitare" Abilita moduli (C e Objective-C) e dovrebbe essere SÌ.

e pulire e costruire il tuo progetto. Se ancora non funziona, controlla le tue librerie binarie di collegamento. In My Mine, questi sono quadri.

Accounts.framework 
AddressBook.framework 
Foundation.framework 
CFNetwork.framework 
GoolgeMaps.Framework 
Social.framework 
CoreData.framework 
QuartzCore.framework 
Security.framework 
CoreLocation.framework 
CoreGraphics.framework 
UIKit.framework 

Prova! Grazie

+1

Ho provato a seguire le tue istruzioni e ho ricevuto altri 45 errori – Armin

+0

WOW! Ha funzionato. Ho guardato un po 'di tempo per la risposta a questo. Dovresti avere più di 100 voti :-) –

0

Ciò che ha riparato il mio problema era aggiungere i framework di Facebook ai framework e alle librerie collegate. Nota, questo non è stato incluso nella documentazione di accesso di Facebook.

Problemi correlati