2016-06-03 29 views
7

La mia app iOS Firebase ho dovuto inserire manualmente i framework a causa di qualche motivo in cocoapods.Firebase Crash .. iOS Swift

Sono stato sempre un errore incidente dicendo

2016-06-04 00:48:51.356 NewFirebase[74218:11918327] Configuring the default app. 
2016-06-04 00:48:51.401 NewFirebase[74218:11918425] +[NSData gtm_dataByGzippingData:]: unrecognized selector sent to class 0x10bdd8110 
2016-06-04 00:48:51.403 NewFirebase[74218:] <FIRAnalytics/INFO> Firebase Analytics v.3200000 started 
2016-06-04 00:48:51.404 NewFirebase[74218:11918425] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData gtm_dataByGzipping 

L'unica linea che ho messo relative al Firebase è

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

     FIRApp.configure() 


     FBSDKApplicationDelegate.sharedInstance().application(application, 
                   didFinishLaunchingWithOptions: launchOptions) 

     return true 
    } 

altra è legata alla facebook Entra Sto andando mettere con Firebase

Questi sono i quadri in esso Frameworks

Questo è ciò che la sezione linker si presenta come nelle impostazioni di generazione Linker Flags Section

esitate se volete qualsiasi codice più

se mi libero di FIRApp.configure() Tutto funziona bene come dovrebbe essere ..

+0

Hai scaricato e aggiunto un elenco di proprietà GoogleService-Info da console.firebase.google.com? – beyowulf

+0

Ehi, stai meglio di me: 101 errori di linker. Ho seguito le istruzioni nel README, che dicono che sono per Xcode 7. – 7stud

+0

Ho riscontrato lo stesso problema. Sembra che la documentazione di Google sia incompleta. Ho scelto di non usare CocoaPods, sto importando tutte le librerie e ho impostato l'opzione -Objc "Other Linker Flag". Ancora si blocca. –

risposta

3

Sto utilizzando Xcode 7.3.1 con targeting iOS 9.3 su OS X 10.11.5.

Ho avuto lo stesso problema di cui sopra con il problema "Simboli indefiniti".

Ho prima svuotato tutto da "Altri linker flag" e aggiunto $ (OTHER_LDFLAGS) e -ObjC come 2 elementi separati (utilizzando il pulsante + quando si fa doppio clic).

L'altra cosa che ho fatto è stata rimuovere i framework che mi davano problemi - GoogleUtilities e FirebaseAnalytics.

Quindi li ho aggiunti nuovamente utilizzando l'opzione "Aggiungi file al progetto" uno alla volta e ho assicurato che fossero indirizzati alla mia app iOS.

La compilazione ha avuto esito positivo e gli annunci vengono visualizzati.

+0

Grazie, risolvi anche il mio problema! Ho aggiunto 3 righe $ (ereditato) $ (OTHER_LDFLAGS) -ObjC –

8

aggiungere due parametri in Altre Bandiere Linker

$(inherited) 
-ObjC 

enter image description here

+0

Non funziona per me. – 7stud

+0

@ 7stud puoi menzionare i tuoi errori di collegamento – Pratik

+0

Il 'Guida introduttiva' collega a ciò che l'op ha usato, e il README di' framework SDK' dice di usare semplicemente '-ObjC'. – 7stud

1

risposta per un commento sopra:

Edit: Ecco ciò che il mio Build Settings assomigliare:

Il README.md nella directory Firebase detto di trascinare il file Firebase.h nel progetto, così come il file module.modulemap e aggiungere il percorso del file module.modulemap al User Header Search Paths: enter image description here

il README.md nella directory Firebase ha detto di entrare solo -ObjC qui: enter image description here

Ecco ciò che il mio Project Navigator assomiglia: enter image description here

Ld /Users/7stud/Library/Developer/Xcode/DerivedData/FirebaseApplicationExample-ewixbbawksqkuaaqeeobeaexeirc/Build/Products/Debug-iphonesimulator/FirebaseApplicationExample.app/FirebaseApplicationExample normal x86_64 
    cd /Users/7stud/xcode_projects/iOS/FirebaseApplicationExample 
    export IPHONEOS_DEPLOYMENT_TARGET=9.2 
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -L/Users/7stud/Library/Developer/Xcode/DerivedData/FirebaseApplicationExample-ewixbbawksqkuaaqeeobeaexeirc/Build/Products/Debug-iphonesimulator -F/Users/7stud/Library/Developer/Xcode/DerivedData/FirebaseApplicationExample-ewixbbawksqkuaaqeeobeaexeirc/Build/Products/Debug-iphonesimulator -F/Users/7stud/xcode_projects/iOS/FirebaseApplicationExample/FirebaseApplicationExample -filelist /Users/7stud/Library/Developer/Xcode/DerivedData/FirebaseApplicationExample-ewixbbawksqkuaaqeeobeaexeirc/Build/Intermediates/FirebaseApplicationExample.build/Debug-iphonesimulator/FirebaseApplicationExample.build/Objects-normal/x86_64/FirebaseApplicationExample.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.2 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/7stud/Library/Developer/Xcode/DerivedData/FirebaseApplicationExample-ewixbbawksqkuaaqeeobeaexeirc/Build/Intermediates/FirebaseApplicationExample.build/Debug-iphonesimulator/FirebaseApplicationExample.build/Objects-normal/x86_64/FirebaseApplicationExample.swiftmodule -framework FirebaseDatabase -framework GoogleInterchangeUtilities -framework FirebaseAnalytics -framework GoogleSymbolUtilities -framework GoogleUtilities -framework FirebaseInstanceID -Xlinker -dependency_info -Xlinker /Users/7stud/Library/Developer/Xcode/DerivedData/FirebaseApplicationExample-ewixbbawksqkuaaqeeobeaexeirc/Build/Intermediates/FirebaseApplicationExample.build/Debug-iphonesimulator/FirebaseApplicationExample.build/Objects-normal/x86_64/FirebaseApplicationExample_dependency_info.dat -o /Users/7stud/Library/Developer/Xcode/DerivedData/FirebaseApplicationExample-ewixbbawksqkuaaqeeobeaexeirc/Build/Products/Debug-iphonesimulator/FirebaseApplicationExample.app/FirebaseApplicationExample 

Undefined symbols for architecture x86_64: 
    "_ABAddressBookAddRecord", referenced from: 
     -[GSDK_GTMABAddressBook addRecord:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookCopyArrayOfAllGroups", referenced from: 
     -[GSDK_GTMABAddressBook groups] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookCopyArrayOfAllPeople", referenced from: 
     -[GSDK_GTMABAddressBook people] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookCopyLocalizedLabel", referenced from: 
     +[GSDK_GTMABAddressBook localizedLabel:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookCopyPeopleWithName", referenced from: 
     -[GSDK_GTMABAddressBook peopleWithCompositeNameWithPrefix:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookCreateWithOptions", referenced from: 
     -[GSDK_GTMABAddressBook init] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookGetGroupWithRecordID", referenced from: 
     -[GSDK_GTMABAddressBook groupForId:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookGetPersonWithRecordID", referenced from: 
     -[GSDK_GTMABAddressBook personForId:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookHasUnsavedChanges", referenced from: 
     -[GSDK_GTMABAddressBook hasUnsavedChanges] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookRemoveRecord", referenced from: 
     -[GSDK_GTMABAddressBook removeRecord:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABAddressBookSave", referenced from: 
     -[GSDK_GTMABAddressBook save] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABGroupAddMember", referenced from: 
     -[GSDK_GTMABGroup addMember:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABGroupCopyArrayOfAllMembers", referenced from: 
     -[GSDK_GTMABGroup members] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABGroupCreate", referenced from: 
     -[GSDK_GTMABGroup init] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABGroupRemoveMember", referenced from: 
     -[GSDK_GTMABGroup removeMember:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueAddValueAndLabel", referenced from: 
     -[GSDK_GTMABMutableMultiValue addValue:withLabel:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueCopyLabelAtIndex", referenced from: 
     -[GSDK_GTMABMultiValue labelAtIndex:] in GoogleUtilities(GTMABAddressBook.o) 
     -[GSDK_GTMABMultiValueEnumerator nextObject] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueCopyValueAtIndex", referenced from: 
     -[GSDK_GTMABMultiValue valueAtIndex:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueCreateMutable", referenced from: 
     -[GSDK_GTMABMutableMultiValue initWithPropertyType:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueCreateMutableCopy", referenced from: 
     -[GSDK_GTMABMutableMultiValue initWithMultiValue:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueGetCount", referenced from: 
     -[GSDK_GTMABMultiValue count] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueGetIdentifierAtIndex", referenced from: 
     -[GSDK_GTMABMultiValue identifierAtIndex:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueGetIndexForIdentifier", referenced from: 
     -[GSDK_GTMABMultiValue indexForIdentifier:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueGetPropertyType", referenced from: 
     -[GSDK_GTMABMultiValue propertyType] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueInsertValueAndLabelAtIndex", referenced from: 
     -[GSDK_GTMABMutableMultiValue insertValue:withLabel:atIndex:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueRemoveValueAndLabelAtIndex", referenced from: 
     -[GSDK_GTMABMutableMultiValue removeValueAndLabelAtIndex:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueReplaceLabelAtIndex", referenced from: 
     -[GSDK_GTMABMutableMultiValue replaceLabelAtIndex:withLabel:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABMultiValueReplaceValueAtIndex", referenced from: 
     -[GSDK_GTMABMutableMultiValue replaceValueAtIndex:withValue:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABPersonCopyImageData", referenced from: 
     -[GSDK_GTMABPerson imageData] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABPersonCopyLocalizedPropertyName", referenced from: 
     +[GSDK_GTMABPerson localizedPropertyName:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABPersonCreate", referenced from: 
     -[GSDK_GTMABPerson init] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABPersonGetCompositeNameFormat", referenced from: 
     +[GSDK_GTMABPerson compositeNameFormat] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABPersonGetTypeOfProperty", referenced from: 
     +[GSDK_GTMABPerson typeOfProperty:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABPersonRemoveImageData", referenced from: 
     -[GSDK_GTMABPerson setImageData:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABPersonSetImageData", referenced from: 
     -[GSDK_GTMABPerson setImageData:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABRecordCopyCompositeName", referenced from: 
     -[GSDK_GTMABPerson compositeName] in GoogleUtilities(GTMABAddressBook.o) 
     -[GSDK_GTMABGroup compositeName] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABRecordCopyValue", referenced from: 
     -[GSDK_GTMABRecord valueForProperty:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABRecordGetRecordID", referenced from: 
     -[GSDK_GTMABRecord recordID] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABRecordRemoveValue", referenced from: 
     -[GSDK_GTMABRecord removeValueForProperty:] in GoogleUtilities(GTMABAddressBook.o) 
    "_ABRecordSetValue", referenced from: 
     -[GSDK_GTMABRecord setValue:forProperty:] in GoogleUtilities(GTMABAddressBook.o) 
    "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(char const*) const", referenced from: 
     leveldb::VersionSet::Recover() in FirebaseDatabase(version_set.o) 
    "std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from: 
     void std::__1::vector<std::__1::pair<int, leveldb::FileMetaData>, std::__1::allocator<std::__1::pair<int, leveldb::FileMetaData> > >::__push_back_slow_path<std::__1::pair<int, leveldb::FileMetaData> const>(std::__1::pair<int, leveldb::FileMetaData> const&) in FirebaseDatabase(db_impl.o) 
     void std::__1::vector<unsigned long long, std::__1::allocator<unsigned long long> >::__push_back_slow_path<unsigned long long const>(unsigned long long const&) in FirebaseDatabase(db_impl.o) 
     void std::__1::vector<leveldb::DBImpl::CompactionState::Output, std::__1::allocator<leveldb::DBImpl::CompactionState::Output> >::__push_back_slow_path<leveldb::DBImpl::CompactionState::Output const>(leveldb::DBImpl::CompactionState::Output const&) in FirebaseDatabase(db_impl.o) 
     void std::__1::vector<leveldb::Iterator*, std::__1::allocator<leveldb::Iterator*> >::__push_back_slow_path<leveldb::Iterator* const>(leveldb::Iterator* const&) in FirebaseDatabase(db_impl.o) 
... 
... 
     "_utf8_nextCharSafeBody", referenced from: 
      -[FSRWebSocket _innerPumpScanner] in FirebaseDatabase(FSRWebSocket.o) 
    ld: symbol(s) not found for architecture x86_64 
    clang: error: linker command failed with exit code 1 (use -v to see invocation) 
    Showing first 200 notices only 
0

Aggiungendo questo flag del linker ha risolto il problema per me. Avevo provato a utilizzare CocoaPods per primo, ma non riuscivo a importare nessuno dei moduli Firebase più specifici. L'aggiunta dei framework ha funzionato direttamente, ma solo se è stato aggiunto il flag link -ObjC.

14

è necessario aggiungere queste librerie

  • libC++. TBD
  • libsqlite3.tbd
  • AddressBook.framework

a collegamento binari con le librerie.

Vai a Target -> Crea Fasi

http://i.stack.imgur.com/BpZWD.jpg

+0

Ho anche dovuto aggiungere 'libz.tbd' oltre a quelli sopra. –

+0

Questo ha risolto la build per me. Come mai non è nelle istruzioni di installazione? Un messaggio di errore molto criptico. –

3

Ho appena perso ore per questo - il readme e la documentazione è davvero scadente

È inoltre necessario includere il GoogleToolboxForMac.framework ho perso questo come pensavo fosse per le app per Mac, ma aggiungendolo nel problema risolto.

+0

Hai salvato la mia giornata, ho pensato la stessa cosa e questo lo ha risolto – AlBeebe

+0

Grazie mille per questa risposta! – Eric

0

Stavo solo trascinando file di codice e framework da un altro progetto e ho riscontrato questo problema. Dopo aver aggiunto tutti i framework in fase di build, l'aggiunta di -ObjC in "altri flag del linker" ha risolto il problema.

0

Ho fissato questo problema rimuovendo FirebaseNanoPB e FirebaseCoreDiagnostics quadro dal mio progetto.

Problemi correlati