“Pods”目标在安装GCM时具有传递依赖性,包括静态二进制文件
我正在尝试为我的iOS应用程序安装Google Cloud Messaging(使用swift)。 我已经将它添加到我的Podfile中,如下所示:
# Uncomment this line to define a global platform for your project # platform :ios, '8.2' use_frameworks! target 'Project' do pod 'Alamofire', '~> 1.2' pod 'Google/CloudMessaging' end target 'ProjectTests' do end
现在,当我尝试安装依赖关系时,出现错误(请参阅下文)。 在我添加GoogleCloudMessaging之前,它运行良好。 我试图做一个新的项目,并添加它,而不是看它是否工作,我得到了同样的错误。
Analyzing dependencies Downloading dependencies Installing Alamofire (1.2.3) Installing GGLInstanceID (1.0.0) Installing Google (1.0.7) Installing GoogleCloudMessaging (1.0.3) Installing GoogleInterchangeUtilities (1.0.0) Installing GoogleNetworkingUtilities (1.0.0) Installing GoogleSymbolUtilities (1.0.0) Installing GoogleUtilities (1.0.1) [!] The '<Project name>' target has transitive dependencies that include static binaries: (/Users/User/Documents/Test/Pods/GGLInstanceID/Libraries/libGGLInstanceIDLib.a, /Users/User/Documents/Test/Pods/Google/Libraries/libGGLCloudMessaging.a, /Users/User/Documents/Test/Pods/Google/Libraries/libGGLCore.a, /Users/User/Documents/Test/Pods/GoogleCloudMessaging/Libraries/libGcmLib.a, /Users/User/Documents/Test/Pods/GoogleInterchangeUtilities/Libraries/libProtocolBuffers.a, /Users/User/Documents/Test/Pods/GoogleNetworkingUtilities/Libraries/libGTMSessionFetcher_full.a, /Users/User/Documents/Test/Pods/GoogleNetworkingUtilities/Libraries/libGTMSessionFetcher_core.a, /Users/User/Documents/Test/Pods/GoogleSymbolUtilities/Libraries/libGSDK_Overload.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_iPhone.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_core.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_UIFont+LineHeight.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_SystemVersion.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_StringEncoding.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_RoundedRectPath.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_Regex.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_NSStringXML.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_NSStringHTML.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_NSScannerJSON.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_NSDictionary+URLArguments.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_KVO.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_GTMURLBuilder.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_DebugUtils.a, /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTM_AddressBook.a, and /Users/User/Documents/Test/Pods/GoogleUtilities/Libraries/libGTMStackTrace.a)
任何想法如何我可以解决这个问题? 是否有可能安装GCM没有Cocoapods?
更新
使用Cocoapods V 0.38.2,现在可以使用GMC,或者其他任何带有Swift框架的Objective-C框架,比如Alamofire
确保你使用use_frameworks!
在podfile中
# Uncomment this line to define a global platform for your project # platform :ios, '8.2' use_frameworks! target 'Project' do pod 'Google' pod 'Google/CloudMessaging' pod 'Alamofire' end target 'ProjectTests' do end
老答案
我也使用Swift项目,我只使用Objective-C框架,因为Swift&Objective-C框架还没有为我工作。
尝试只安装GCM,而不使用use_frameworks!
没有Alamofire框架(用Swift编写)
# Uncomment this line to define a global platform for your project # platform :ios, '8.2' target 'Project' do pod 'Google' pod 'Google/CloudMessaging' end target 'ProjectTests' do end
当我在桥接头文件中导入GCM时遇到了一些问题。 我很好奇,如果你遇到同样的问题。
当BridingHeader或GGLInstanceIDDelegate不工作时,解决Google云消息传递的方法是安装“Google” pod 'Google'
我遇到了与Google/Analytics
相同的问题。
这个问题可以在最新版本的CocoaPods中解决。
看到这个: https : //github.com/CocoaPods/CocoaPods/issues/3194
Google / CloudMessaging pod本身存在问题。 由于某些静态依赖关系,此窗格不能构build为框架。 你可以尝试迦太基build立你快速的依赖。
我有一个类似的问题。 我的荚是0.37.2。 如https://github.com/googlesamples/google-services/issues/22中所述,我已更新至0.38.2。 解决了它