Parse和GMaps iOS SDK在Swift中不兼容?

时间:2015-04-22 05:23:42

标签: ios objective-c swift parse-platform google-maps-sdk-ios

我正在构建一个带有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.frameworkAccounts.framework,以及ParseBoltsParseFacebookUtilsV4添加。我删除了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?

1 个答案:

答案 0 :(得分:4)

我也有这个问题.. 我添加了一些进一步的框架,让shure你拥有所有这些:

enter image description here

使用所有这些框架,-ObjC Linker Flag解析和gmaps应该一起工作。