我正在构建一个带有Parse集成的Swift应用程序,它可以正常工作。但是,当我尝试添加Google Maps iOS SDK集成时,会出现以下构建错误:
Undefined symbols for architecture x86_64:
"_FBTokenInformationExpirationDateKey", referenced from:
-[PFFacebookTokenCachingStrategy cacheTokenInformation:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy expirationDate] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setExpirationDate:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationTokenKey", referenced from:
-[PFFacebookTokenCachingStrategy accessToken] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setAccessToken:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationUserFBIDKey", referenced from:
-[PFFacebookTokenCachingStrategy facebookId] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setFacebookId:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_OBJC_CLASS_$_FBAppCall", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBRequest", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSDKAccessToken", referenced from:
objc-class-ref in ParseFacebookUtilsV4(PFFacebookUtils.o)
objc-class-ref in ParseFacebookUtilsV4(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSDKApplicationDelegate", referenced from:
objc-class-ref in ParseFacebookUtilsV4(PFFacebookUtils.o)
"_OBJC_CLASS_$_FBSDKLoginManager", referenced from:
objc-class-ref in ParseFacebookUtilsV4(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSDKSettings", referenced from:
objc-class-ref in ParseFacebookUtilsV4(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSession", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_CLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in
....
google_breakpadPFC_::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in ParseCrashReporting(minidump_generator.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
在我的项目目标中,在Linked Frameworks and Libraries
下,我添加了Social.framework
和Accounts.framework
,以及Parse
,Bolts
和ParseFacebookUtilsV4
添加。我删除了ParseFacebookUtils
。 (我按照Parse文档的说明和this等答案。)
对于Google Maps iOS SDK,我向-ObjC
添加了Other Linker Flags
,因为这是Swift兼容性所必需的。
这里的问题似乎是Parse和GMaps iOS SDK之间不兼容,因为-ObjC linker flag
会导致Parse构建错误,但如果没有它,GMaps将无效。我使用的是最新版本的Parse SDK和Google Maps iOS SDK。
是否有人在Swift应用中成功整合了Parse和Google Maps iOS SDK?
答案 0 :(得分:4)
我也有这个问题.. 我添加了一些进一步的框架,让shure你拥有所有这些:
使用所有这些框架,-ObjC Linker Flag
解析和gmaps应该一起工作。