将Google Maps SDK与Parse.com Project iOS Swift结合使用

SKYnine

我正在使用Parse SDK(parse.com)处理数据的项目(xcode 6.3 +,swift)。最近,我们决定使用Google Maps sdk通过Direction API向用户提供路线。由于您可以在没有Google Map的情况下使用此API,因此我开始对其进行集成。这是我第一次接触cocoapods,所以我按照说明开始玩。

pod init 创建pod规格文件

这是我的配置来自谷歌入门指南

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
pod 'GoogleMaps'

pod install,然后使用 .xworkspace

我直接尝试构建该项目,它返回34个错误。错误类型始终相同:Apple Match-O Linker Error

在此处输入图片说明

在此处输入图片说明

So I start looking at google cause I did the same thing on a blank project and everything was working really good.

I start to find information about the fact that using Parse SDK causes conflicts with the -ObjC linker Flags that GoogleMaps needs to work. most of the answers give two potential solutions:

1. addind the Facebook-iOS-SDK framework

tried this using the framework given by facebook, as well as using cocoapods. not working. I still got errors.

2. Force Loading the GoogleMaps framework by replacing the -ObjC flag by the following

-force_load $(PROJECT_DIR)/Pods/GoogleMaps/Frameworks/GoogleMaps.framework

this returns an error as well: 在此处输入图片说明

so now Im quite lost about the way to solve this. Is there anybody that found a way to integrate GoogleMaps SDK with Parse?

UPDATE

I tried a different approach by injecting GoogleMaps without cocoapods. To do this I used this method: GoogleMaps without CocoaPods

It seems to integrate itself properly, but the -ObjC flag remains. Using

-force_load $(PROJECT_DIR)/GoogleMaps.framework/GoogleMaps

is now responding but causing duplicate symbols for architecture x86_64errors. can't seems to find a way to fix that.

SKYnine

Ok so I managed to find working solution both for integrating GoogleMaps Sdk and Parse with and without cocoapods. However, the use of the -ObjC flags by GoogleMaps forced me to integrate the FacebookSDK to the equation. I couldn't find a way to make this working without it

So this config is working with xcode 6.3+ and it required to use and older version of the Facebook SDK (when not using cocoapods)

With CocoaPods

1/. Add the Parse SDK as described on their website (existing project version)

2/. Add extra Frameworks (AdSupport, Account and Social) as well as libstdc++.6.dylib

3/. Open terminal to the root folder

4/. $ pod init

5/. open Podfile and replace content with the following:

use_frameworks! 
platform :ios, ‘8.0’
pod 'GoogleMaps'

6/. $ pod install then $ pod update

7/. download FacebookSDK from this link

8/. Add FBSDKCoreKit and FBSDKLoginKit Frameworks to your project

9/. build your project.

If some error occurs, you may have to delete ParseFacebookUtils.framework from your project and keep only ParseFacebookUtilsV4.

Without CocoaPods

So this is quite the same procedure except that instead of using pods to install GoogleMaps SDK, you will integrate it manually by using the link mentionned in the question, or by going to GoogleMaps podspecs and access the source url to download the last one.

Make sure to add GoogleMaps.framework, as well as the GoogleMaps.bundle which you can find by right-click on GoogleMaps.framework /show in finder under Resources. Drag and drop to the project and make sure it's linked to the project build settings / Copy Bundle Resources

Also, make sure to have all the required framework and libraries listed on the link provided in the question.

Add the -ObjC flag under Build Settings / Other Linker Flags

When it comes to integrate the FacebookSDK, I've noticed that using the latest version isn't working. Apparently, it was prepared to work with xcode 7. Do work around this, just download an older version here

Add FBSDKCoreKit and FBSDKLoginKit to the project and you should be good to go. Hope that help someone cause it was a pain to make this work...

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Google Maps iOS SDK崩溃

来自分类Dev

Swift中的Google Maps iOS SDK代码有什么作用?

来自分类Dev

iOS Swift Google Maps SDK 在特定缩放级别显示标记?

来自分类Dev

使用Parse的com.facebook.sdk错误2 iOS应用

来自分类Dev

使用Google Maps SDK CocoaPod安装和iOS小部件

来自分类Dev

在iOS Google Maps SDK中使用跨宽度渐变的折线

来自分类Dev

UISwitch无法在iOS版Google Maps SDK上使用吗?

来自分类Dev

iOS Google Maps SDK-在后台使用位置

来自分类Dev

Google Maps IOS SDK是否可以免费使用?

来自分类Dev

UISwitch无法在iOS版Google Maps SDK上使用吗?

来自分类Dev

定义应用正在使用Google Maps iOS SDK路由应用

来自分类Dev

将Django与Parse.com结合使用

来自分类Dev

Google Maps iOS SDK和情节提要

来自分类Dev

Google Maps SDK版本问题-IOS

来自分类Dev

Google Maps iOS SDK崩溃-GMSBackgroundAppException

来自分类Dev

缩小iOS版Google Maps SDK的大小

来自分类Dev

Google Maps iOS SDK触摸事件

来自分类Dev

Google Maps SDK iOS卫星视图

来自分类Dev

Google Maps iOS SDK 1.6使其闪烁

来自分类Dev

在适用于本机iOS / Swift的Google Maps SDK中获取位置标记

来自分类Dev

在Swift中绘制自定义的polyglon Google Maps iOS SDK

来自分类Dev

将iOS 7 SDK与llvm-gcc-4.2结合使用

来自分类Dev

在parse.com上的iOS中使用Google Plus登录

来自分类Dev

在parse.com上的ios中使用Google Plus登录

来自分类Dev

使用iOS版Google Maps SDK优化自定义标记图像的性能

来自分类Dev

是否可以使用iOS Google Maps SDK检索路线的时间?

来自分类Dev

如何使用iOS版Google Maps SDK检测点在多边形内?

来自分类Dev

使用适用于iOS的Google Maps SDK(版本1.9.0)提交我的应用时出现警告

来自分类Dev

如何使用iOS版Google Maps Platform SDK而不是CoreLocation获取用户位置

Related 相关文章

  1. 1

    Google Maps iOS SDK崩溃

  2. 2

    Swift中的Google Maps iOS SDK代码有什么作用?

  3. 3

    iOS Swift Google Maps SDK 在特定缩放级别显示标记?

  4. 4

    使用Parse的com.facebook.sdk错误2 iOS应用

  5. 5

    使用Google Maps SDK CocoaPod安装和iOS小部件

  6. 6

    在iOS Google Maps SDK中使用跨宽度渐变的折线

  7. 7

    UISwitch无法在iOS版Google Maps SDK上使用吗?

  8. 8

    iOS Google Maps SDK-在后台使用位置

  9. 9

    Google Maps IOS SDK是否可以免费使用?

  10. 10

    UISwitch无法在iOS版Google Maps SDK上使用吗?

  11. 11

    定义应用正在使用Google Maps iOS SDK路由应用

  12. 12

    将Django与Parse.com结合使用

  13. 13

    Google Maps iOS SDK和情节提要

  14. 14

    Google Maps SDK版本问题-IOS

  15. 15

    Google Maps iOS SDK崩溃-GMSBackgroundAppException

  16. 16

    缩小iOS版Google Maps SDK的大小

  17. 17

    Google Maps iOS SDK触摸事件

  18. 18

    Google Maps SDK iOS卫星视图

  19. 19

    Google Maps iOS SDK 1.6使其闪烁

  20. 20

    在适用于本机iOS / Swift的Google Maps SDK中获取位置标记

  21. 21

    在Swift中绘制自定义的polyglon Google Maps iOS SDK

  22. 22

    将iOS 7 SDK与llvm-gcc-4.2结合使用

  23. 23

    在parse.com上的iOS中使用Google Plus登录

  24. 24

    在parse.com上的ios中使用Google Plus登录

  25. 25

    使用iOS版Google Maps SDK优化自定义标记图像的性能

  26. 26

    是否可以使用iOS Google Maps SDK检索路线的时间?

  27. 27

    如何使用iOS版Google Maps SDK检测点在多边形内?

  28. 28

    使用适用于iOS的Google Maps SDK(版本1.9.0)提交我的应用时出现警告

  29. 29

    如何使用iOS版Google Maps Platform SDK而不是CoreLocation获取用户位置

热门标签

归档