xcode CocoaPods“目标具有包含静态二进制文件的传递依赖项”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42611599/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CocoaPods "target has transitive dependencies that include static binaries"
提问by Satish
I'm trying to install a swift framework I found on GitHub along with the GoogleMaps, GooglePlaces into my Xcode project but for some reason when I try to install the pod file its giving the following error
我正在尝试将我在 GitHub 上找到的 swift 框架以及 GoogleMaps、GooglePlaces 安装到我的 Xcode 项目中,但是由于某种原因,当我尝试安装 pod 文件时,出现以下错误
[!] The 'Pods-project1' target has transitive dependencies that include static binaries: (/Users/user1/Desktop/project1/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework, /Users/user1/Desktop/project1/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework, and /Users/user1/Desktop/project1/Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework)
[!] 'Pods-project1' 目标具有传递依赖项,包括静态二进制文件:(/Users/user1/Desktop/project1/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework, /Users/user1/Desktop/project1/Pods /GoogleMaps/Maps/Frameworks/GoogleMaps.framework 和 /Users/user1/Desktop/project1/Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework)
Here is my Pod File I'm trying to install:
这是我尝试安装的 Pod 文件:
#Uncomment the next line to define a global platform for your project
#platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'project1' do
pod 'GooglePlaces'
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'
pod 'PopupDialog'
end
Also here is the link to the swift framework that I'm trying to install: https://github.com/Orderella/PopupDialog
这里也是我尝试安装的 swift 框架的链接:https: //github.com/Orderella/PopupDialog
I don't what to do, I've tried multiple things but non of them seem to work. Any help would be appreciated.
我不知道该怎么做,我尝试了多种方法,但似乎都不起作用。任何帮助,将不胜感激。
回答by Anson Yao
It is because "Google-Maps-iOS-Utils" is not a dynamic library while you used "use_frameworks!" in your Podfile. Unfortunately, for this library, we need to install it manually for a Swift project. You can check detailed explanation here:
这是因为当您使用“use_frameworks!”时,“Google-Maps-iOS-Utils”不是动态库。在你的 Podfile 中。不幸的是,对于这个库,我们需要为 Swift 项目手动安装它。您可以在此处查看详细说明:
https://github.com/googlemaps/google-maps-ios-utils/blob/master/Swift.md
https://github.com/googlemaps/google-maps-ios-utils/blob/master/Swift.md
回答by Abhishek Mitra
I think i have found the solution, I tested myself through yourway and found the same error, So i gone through one by one pod installation, and its works and installed perfectly, but "pod 'Google-Maps-iOS-Utils'" is the reason for arising the error, instead putting this in your podfile, remove that and keep this three under your target.
我想我已经找到了解决方案,我通过你的方式测试了自己并发现了同样的错误,所以我一个一个地安装了 pod,它的工作原理和安装完美,但是“ pod 'Google-Maps-iOS-Utils'”是出现错误的原因,而不是把它放在你的 podfile 中,删除它并将这三个保留在你的目标之下。
pod 'GooglePlaces'
pod 'GooglePlaces'
pod 'GoogleMaps'
豆荚“谷歌地图”
pod ‘PopupDialog'
吊舱“弹出对话框”
Install them, it will install perfectly.
安装它们,它将完美安装。
Now, in terminal when all dependencies installed successfully, run "pod try Google-Maps-iOS-Utils", it will started installing, then you would get options for like:
现在,在所有依赖项安装成功后,在终端中运行“pod try Google-Maps-iOS-Utils”,它将开始安装,然后您将获得以下选项:
1: samples/ObjCDemoApp/ObjCDemoApp.xcodeproj
1:样本/ObjCDemoApp/ObjCDemoApp.xcodeproj
2: samples/SwiftDemoApp/SwiftDemoApp.xcodeproj
2:示例/SwiftDemoApp/SwiftDemoApp.xcodeproj
3: workspace/GoogleMapsUtils.xcodeproj
3:工作区/GoogleMapsUtils.xcodeproj
Which project would you like to open ? select your number (eg 3) then press enter
您想打开哪个项目?选择您的号码(例如 3),然后按 Enter
Here you have selected your project and proceed accordingly. (y) and you have done.
在这里您已经选择了您的项目并相应地进行。(y) 你已经完成了。
回答by Anjali Kevadiya
I worked with GoogleMap and i had this same error and it is just because of pod 'Google-Maps-iOS-Utils' xcode gives this error. I removed pod 'Google-Maps-iOS-Utils' and just keep pod 'GoogleMaps'. And it works for me. Hope it would be work for you as well.
我与 GoogleMap 一起工作,我遇到了同样的错误,这只是因为 pod 'Google-Maps-iOS-Utils' xcode 给出了这个错误。我删除了pod 'Google-Maps-iOS-Utils' 并保留了pod 'GoogleMaps'。它对我有用。希望它也适合你。