iOS GCM示例的Podfile无效

我正在尝试安装GCM示例Xcode项目,请遵循Google开发者页面上的说明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' # ------------------------------------------ 

我已经尝试修改错误消息中build议的podfile,但即使使用--no-repo-update option并生成相同的错误,也会重新生成Podfile。

我没有任何经验的豆荚,所以任何build议表示赞赏。

转到path:“/ private / var / folders / lx / 78jh00l90p95cs1cy_545t2r0000gn / T / CocoaPods / Try / Google / 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安装