我已經將FacebookSDK添加到我的Unity項目中,根據教程https://developers.facebook.com/docs/unity/getting-started/canvas/。面向Unity iOS的FacebookSDK Mach-O鏈接器錯誤 - 未定義的符號_iosLogin,
這意味着我已經下載SDK .unitypackage,將其導入Unity項目並在配置設置檢查器中設置應用程序名稱和ID。
當我嘗試爲設備,Xcode的構建掛在下面的Mach-O鏈接錯誤:
Undefined symbols for architecture armv7:
"_iosLogin", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosLogout", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosInit", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosSetShareDialogMode", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFeedRequest", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosAppRequest", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBSettingsPublishInstall", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBAppEventsSetLimitEventUsage", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosGetDeepLink", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBAppEventsLogPurchase", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBAppEventsLogEvent", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
它看起來像團結,Xcode的還是我忘了,包括一些圖書館,搜索路徑或源文件的某處。你能幫我找出發生了什麼事嗎?你知道這個符號應該在哪個文件中,或者如何設置鏈接器?
Unity 4.3.0f4 (also tried 4.2.?)
Facebook SDK 4.3.4 (also tried 4.3.3)
Xcode 5.0.2, deployment target 4.0 (also tried 6.1)
謝謝你的建議。 我已經檢查過Unity腳本,並且在ParseDictionary方法中的Facebook/Editor/iOS/third_party/XCodeEditor-for-Unity/PBXParser.cs中發現錯誤。有一個企圖dictionary.Add()與重複鍵184行。我認爲有一些配置文件本身沒有問題,但我已經添加檢查重複鍵,然後我能夠建立。但只是第一次(或刪除iOS生成文件夾後)。不要構建現有的項目。 如果我嘗試第二個(第三,...)構建和運行,Unity會生成格式錯誤的xml Info.plist。 –
另一個發現:當我用Replace替代Append而第二次構建時,它沒有錯誤地構建,所以它可能是另一個錯誤。 所以我認爲它解決了。也許它可能是可用的,如果你有任何想法爲什麼ParseDictionary會嘗試添加重複鍵或從哪裏獲取數據,但這不是必需的。 –