通过CocoaPods添加Google Maps for iOS的Swift项目中的链接器错误 [英] Linker errors in a Swift project with Google Maps for iOS added via CocoaPods

查看:103
本文介绍了通过CocoaPods添加Google Maps for iOS的Swift项目中的链接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图为Swift添加。



解决这个问题的方法是什么?

解决方案

你面对的问题是CocoaPods畸形的podspec。 请查看获取更多信息。



请随时使用此podspec:

https://raw.githubusercontent.com/Reflejo/GoogleMapsPodspec/master/Google-Maps-iOS-SDK.podspec.json

...在您的Podfile中:

  pod'谷歌地图-iOS-SDK',:podspec => https://raw.githubusercontent.com/Reflejo/GoogleMapsPodspec/master/Google-Maps-iOS-SDK.podspec.json


I'm trying to add Google Maps SDK for iOS for a Swift project I'm working on via CocoaPods since CocoaPods now supports Swift.

Here's my podfile.

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
platform :ios, '7.0'

pod 'Google-Maps-iOS-SDK'

Pod installation completes successfully and I could import the framework like this import GoogleMaps without any compilation errors.

But then I went ahead and added a UIView and set its class to GMSMapView and added a IBOutlet to my view controller and build the project. I get the following error.

Linker command failed with exit code 1 (use -v to see invocation)

I've added and used libraries written in Objective-C like MagicalRecord, MBProgressHUD on Swift projects without any issue.

I uploaded a demo Xcode project here as well.

Any way to resolve this?

解决方案

The problem that you are facing is a combination of a bug on CocoaPods and a malformed podspec. Check this for more information.

Feel free to use this podspec:

https://raw.githubusercontent.com/Reflejo/GoogleMapsPodspec/master/Google-Maps-iOS-SDK.podspec.json

... in your Podfile as:

pod 'Google-Maps-iOS-SDK', :podspec => "https://raw.githubusercontent.com/Reflejo/GoogleMapsPodspec/master/Google-Maps-iOS-SDK.podspec.json"

这篇关于通过CocoaPods添加Google Maps for iOS的Swift项目中的链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆