安装 CocoaPods 时出现传递依赖错误

4
我希望在我的应用程序中集成“使用Google登录”。我尝试使用pods,但是出现了以下错误:
“Pods-ProjectName”目标具有包含静态二进制文件的传递依赖项:ProjectPath/GoogleAppUtilities/Libraries/libOpenInChrome.a 我的Pod文件代码如下:
target 'ProjectName' do

use_frameworks!

pod "OAuthSwift", "~> 0.3.4"
pod "Haneke", "~> 1.0"
pod "Alamofire", "~> 1.2"
pod "IJReachability", :git => "https://github.com/Isuru-Nanayakkara/IJReachability.git"
pod "iCarousel"
pod 'SDWebImage', '~>3.7'
pod 'Google/SignIn'

end

我也在使用Crashlytics。没有使用Google/signIn,我能够成功创建pods工作区。

有什么解决方案吗?


请提供您的 Podfile 代码。 - aramusss
我尝试在 target 'TestProject' doend 之间添加了一行 pod 'GoogleSignIn',然后使用终端中的 pod install 正确地添加了依赖项。 - aramusss
@aramusss 我编辑了我的问题并添加了我的Pod文件代码。 - Rakesh
尝试使用 pod 'GoogleSignIn',然后运行 pod install 和 pod update。 - aramusss
@aramusss 我试过了,还是出现同样的错误。 - Rakesh
3个回答

5
关于CocoaPods 0.36 版本的文档,您无法将静态库添加到项目中。Google 的 pod 似乎依赖一些静态库,导致 pod install 崩溃。
如果您使用 Objective-C,并删除 use_frameworks! 部分,则不会遇到任何问题。
当然,另一个选项是直接将 Google lib 添加到项目中,这样就不需要使用 CocoaPods。

2
将以下代码添加到您的 pod 文件中以忽略传递依赖项:
pre_install do |installer|
    def installer.verify_no_static_framework_transitive_dependencies 
    end
end

如果您正在使用像MIHCrypto这样的Podfile,并将所有依赖库添加到项目中并按照以下方式更改Mach-O类型,则可以使用静态库:

enter image description here


1

前往您的Podfile并插入以下内容

pre_install do |installer|
def installer.verify_no_static_framework_transitive_dependencies; end
end

这对我有用。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接