gpt4 book ai didi

ios - 安装 GCM 时,“'Pods' 目标具有包含静态二进制文件的传递依赖项”

转载 作者:IT王子 更新时间:2023-10-29 08:06:39 24 4
gpt4 key购买 nike

我正在尝试为我的 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)

知道如何解决这个问题吗?是否可以在没有 Cocoapods 的情况下安装 GCM?

最佳答案

更新

通过 Cocoapods V 0.38.2,现在可以使用 GMC 或任何其他带有 Swift 框架(如 Alamofire)的 Objective-C 框架

确保在 podfile 中使用 use_frameworks!

# 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 框架还不适合我。

尝试仅在没有 use_frameworks! 且没有 Alamofire 框架(用 Swift 编写)的情况下安装 GCM

# 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 Cloud Messaging 的解决方案是安装 'Google' pod 'Google'

关于ios - 安装 GCM 时,“'Pods' 目标具有包含静态二进制文件的传递依赖项”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30910852/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com