iOS GCM示例的Podfile无效



我正在按照谷歌开发者页面上的说明安装GCM Example Xcode项目https://developers.google.com/cloud-messaging/ios/start

但在步骤1失败,并显示以下消息:

[!] Invalid `Podfile` file: [!] The specification of `link_with` in the Podfile is now unsupported, please use target blocks instead..

完整的成绩单如下:

$ pod try Google --no-repo-update
Trying Google
1: Samples/admob/AdMobExample.xcodeproj
2: Samples/analytics/AnalyticsExample.xcodeproj
3: Samples/appinvites/AppInvitesExample.xcodeproj
4: Samples/gcm/GcmExample.xcodeproj
5: Samples/signin/SignInExample.xcodeproj
Which project would you like to open
4
Performing CocoaPods Installation
[!] Invalid `Podfile` file: [!] The specification of `link_with` in the Podfile is now unsupported, please use target blocks instead..
 #  from /private/var/folders/d5/f4qpz1r530xbw5cyrbfk094h0000gp/T/CocoaPods/Try/Google/Samples/gcm/Podfile:10
 #  -------------------------------------------
 #  # and delete the link_with command.
 >  link_with 'GcmExample', 'GcmExampleSwift'
 #  ------------------------------------------

我曾尝试按照错误消息中的建议修改podfile,但即使使用--no-repo-update option运行,也会重新生成podfile并产生相同的错误。

我之前没有使用Pods的经验,所以任何建议都很感激。

转到路径:"/private/var/folders/lx/78jh00l90p95cs1cy_545t2r0000gn/T/CooaPods/Try/Googe/Samples/gcm",然后打开pod文件并将其更新为

# GcmExample
 target 'GcmExample' do
  platform :ios, '7.0'
   pod 'Google/CloudMessaging'
end
# If using CocoaPods 1.0.0+, use the new target syntax.
#target 'GcmExample'
#target 'GcmExampleSwift'
# and delete the link_with command.
#link_with 'GcmExample', 'GcmExampleSwift'

然后,pod安装

最新更新