我目前正在使用Unity 5.0.2和Unity FB SDK 7.0.2 Beta在iOS编译过程中遇到问题。
错误是:
Undefined symbols for architecture armv7:
"_iosShareLink", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosSetShareDialogMode", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosLogOut", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosLogInWithReadPermissions", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosLogInWithPublishPermissions", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBAppEventsLogEvent", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosInit", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosJoinGameGroup", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBSettingsActivateApp", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosAppRequest", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBSdkVersion", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosCreateGameGroup", 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
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
如果我使用IL2CPP进行编译,则会显示类似的错误以及一些额外信息
Undefined symbols for architecture armv7:
"_iosShareLink", referenced from:
_IOSFacebook_iosShareLink_m231 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosShareLink_m231, _IOSFacebook_iosShareLink_m231_MethodInfo )
"_iosSetShareDialogMode", referenced from:
_IOSFacebook_iosSetShareDialogMode_m230 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosSetShareDialogMode_m230_MethodInfo, _IOSFacebook_iosSetShareDialogMode_m230 )
"_iosLogOut", referenced from:
_IOSFacebook_iosLogOut_m229 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosLogOut_m229, _IOSFacebook_iosLogOut_m229_MethodInfo )
"_iosLogInWithReadPermissions", referenced from:
_IOSFacebook_iosLogInWithReadPermissions_m227 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosLogInWithReadPermissions_m227_MethodInfo, _IOSFacebook_iosLogInWithReadPermissions_m227 )
"_iosLogInWithPublishPermissions", referenced from:
_IOSFacebook_iosLogInWithPublishPermissions_m228 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosLogInWithPublishPermissions_m228_MethodInfo, _IOSFacebook_iosLogInWithPublishPermissions_m228 )
"_iosFBAppEventsLogEvent", referenced from:
_IOSFacebook_iosFBAppEventsLogEvent_m236 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosFBAppEventsLogEvent_m236, _IOSFacebook_iosFBAppEventsLogEvent_m236_MethodInfo )
"_iosInit", referenced from:
_IOSFacebook_iosInit_m226 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosInit_m226, _IOSFacebook_iosInit_m226_MethodInfo )
"_iosJoinGameGroup", referenced from:
_IOSFacebook_iosJoinGameGroup_m234 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosJoinGameGroup_m234_MethodInfo, _IOSFacebook_iosJoinGameGroup_m234 )
"_iosFBSettingsActivateApp", referenced from:
_IOSFacebook_iosFBSettingsActivateApp_m235 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosFBSettingsActivateApp_m235, _IOSFacebook_iosFBSettingsActivateApp_m235_MethodInfo )
"_iosAppRequest", referenced from:
_IOSFacebook_iosAppRequest_m232 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosAppRequest_m232, _IOSFacebook_iosAppRequest_m232_MethodInfo )
"_iosFBSdkVersion", referenced from:
_IOSFacebook_iosFBSdkVersion_m240 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosFBSdkVersion_m240, _IOSFacebook_iosFBSdkVersion_m240_MethodInfo )
"_iosCreateGameGroup", referenced from:
_IOSFacebook_iosCreateGameGroup_m233 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosCreateGameGroup_m233, _IOSFacebook_iosCreateGameGroup_m233_MethodInfo )
"_iosFBAppEventsSetLimitEventUsage", referenced from:
_IOSFacebook_iosFBAppEventsSetLimitEventUsage_m238 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosFBAppEventsSetLimitEventUsage_m238_MethodInfo, _IOSFacebook_iosFBAppEventsSetLimitEventUsage_m238 )
"_iosGetDeepLink", referenced from:
_IOSFacebook_iosGetDeepLink_m239 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosGetDeepLink_m239, _IOSFacebook_iosGetDeepLink_m239_MethodInfo )
"_iosFBAppEventsLogPurchase", referenced from:
_IOSFacebook_iosFBAppEventsLogPurchase_m237 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _IOSFacebook_iosFBAppEventsLogPurchase_m237, _IOSFacebook_iosFBAppEventsLogPurchase_m237_MethodInfo )
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
任何人都知道如何修复它?
答案 0 :(得分:1)
如果您发现Xcode项目中缺少fbUnityInterface.h
,请尝试以下操作:
在Unity项目中找到该文件,然后在"选择平台插件"中点击iOS的复选框。检查员的方框。
如果没有此复选框,Unity可能不知道.h文件需要包含在构建中,因为它仅在.mm文件中引用,Unity无法解析。
答案 1 :(得分:-1)
问题是XCode项目缺少Facebook绑定文件。
请确保Xcode中存在以下文件。