问题描述
我试图按照Google开发者页面
I am trying to install the GCM Example Xcode project, following the instructions on the Google developers page https://developers.google.com/cloud-messaging/ios/start
但在第1步失败并显示以下消息:
but failing at step 1 with this message:
[!] Invalid `Podfile` file: [!] The specification of `link_with` in the Podfile is now unsupported, please use target blocks instead..
完整的成绩单如下所示:
The full transcript goes like this:
$ 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,但是Podfile即使在使用 - no-repo-update选项
运行时也会产生相同的错误。
I have tried modifying the podfile as suggested in the error message, but the Podfile is regenerated, even when run with the --no-repo-update option
and produces the same error.
推荐答案
转到路径:/ private / var / folders / lx / 78jh00l90p95cs1cy_545t2r0000gn / T / CocoaPods / Try / Google / Samples / gcm然后只需打开pod文件并将其更新为
Go to the path: "/private/var/folders/lx/78jh00l90p95cs1cy_545t2r0000gn/T/CocoaPods/Try/Google/Samples/gcm" then just open the pod file and update it as
# 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 install
Then, pod install
这篇关于iOS GCM示例的无效Podfile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!