2017-02-17 106 views
4

我使用的火力作爲一個項目,我在iOS的工作的一部分,我只是偶然發現,當我嘗試編譯我的代碼針對iPhone 6或7模擬器進行測試下面的鏈接錯誤。用於建築x86_64的火力地堡未定義的符號

Undefined symbols for architecture x86_64: 
    "_OBJC_CLASS_$_GTMSessionUploadFetcher", referenced from: 
     objc-class-ref in FirebaseStorage(FIRStorageUploadTask_d5061b1e2b5f1bb249816cc5fc42ff62.o) 
    "_OBJC_CLASS_$_GTMLogger", referenced from: 
     objc-class-ref in FirebaseMessaging(GIPReachability_ae5504e4a6a28a1d8997c6f38e8bff8b.o) 
    "_kGTMSessionUploadFetcherStandardChunkSize", referenced from: 
     -[FIRStorageUploadTask enqueue] in FirebaseStorage(FIRStorageUploadTask_d5061b1e2b5f1bb249816cc5fc42ff62.o) 
    "_GTMFetcherStandardUserAgentString", referenced from: 
     -[FIRAuthBackendRPCIssuerImplementation init] in FirebaseAuth(FIRAuthBackend_ea73237c278bd1b78e1c76db2a16775a.o) 
    "_OBJC_CLASS_$_GTMSessionFetcher", referenced from: 
     objc-class-ref in FirebaseStorage(FIRStorageDownloadTask_c390366e83519f6636ca985ecb70e5d0.o) 
     objc-class-ref in FirebaseStorage(FIRStorage_691ea9ac7cb4d224d37df2ff8a911989.o) 
    "_OBJC_CLASS_$_GTMSessionFetcherService", referenced from: 
     objc-class-ref in FirebaseAuth(FIRAuthBackend_ea73237c278bd1b78e1c76db2a16775a.o) 
     objc-class-ref in FirebaseStorage(FIRStorage_691ea9ac7cb4d224d37df2ff8a911989.o) 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我使用的Xcode 8.2.1,迅疾3.0,我也有以下波德文件在我的項目

pod 'Braintree' 
pod 'Firebase/Auth' 
pod 'Firebase/Database' 
pod 'Firebase/Core' 
pod 'Firebase/Storage' 
pod 'Firebase/Messaging' 
pod 'Firebase/RemoteConfig' 
pod 'GeoFire', :git=>'https://github.com/firebase/geofire-objc.git' 
pod 'ObjectMapper', '~> 2.2' 

我已經做了莢更新的情況下,一些已經過時的,但沒有運氣。代碼編譯並運行正常,當我使用iPhone 4或5模擬器。

編輯:

我已建立有效的架構爲否,則在有效的架構我所列舉的arm64,ARMv7的,armv7s並且即使import ObjectMapper在文件

Use of undeclared type 'Mappable' 

在宣佈現在Objectmapper失敗任何幫助將不勝感激!先謝謝你。

喬治。

+1

在Xcode標記'構建設置>構建Active Architect只有> YES' –

+0

嗨Sachin,謝謝你的建議,但不幸的是這個設置已經在YES – gdev

+2

對不起,應該是'NO'。 –

回答

1

這似乎是與導出數據的毛刺。我退出Xcode,我刪除了所有派生數據/Users/USER_NAME/Library/Developer/Xcode/PROJECT_NAME

重新啓動的Xcode,編譯和所有預期的工作,無需改變任何東西在Active Architecture Only或任何東西。

8

對我來說,我只裝了火力地堡框架,Xcode中,不使用由於其他無法解決的問題的CocoaPods。在構建之後,會出現類似上面的錯誤,其中帶有「架構x86_64未找到的符號」。

(也許是因爲我在Xcode的VMware合作),那麼我必須手動去一般 - 鏈接的框架和庫並添加:

libsqlite3.tbd,libz.tbd,的libC++ TBD。

爲項目工作。

+0

我只需要添加'libsqlite3.tbd' – Josh

+0

謝謝你,救了你的命! –

0

我試圖解決方案在這個問題上,並沒有什麼工作。在SO和GitHub問題中也發現了其他線程。沒什麼幫助。我正在使用Xcode 9.2,Swift 4,最新版本的可可豆莢。這對我有用...

首先,我的podfile只包含一個firebase pod,因爲我現在只使用Analytics,但是如果您使用的是更多解決方案,則應該是相同的。
pod'Firebase/Core'

其次,像文檔狀態一樣,確保-ObjC已添加到您的其他鏈接器標誌。我在項目和目標級別構建設置中都做了這個。他們是不同的。

第三,也是最重要的,在項目層面構建設置,其它鏈接器標記,添加以下

-framework

「FirebaseCore」

-framework

「FirebaseAnalytics」

-framework

「FirebaseInstanceID」

-framework

「FirebaseNanoPB」

-framework

「FirebaseCoreDiagnostics」

-framework

「nanopb」