简体   繁体   English

使用 Carthage 在 Xcode 中导入 ZipFoundation 不起作用

[英]Importing ZipFoundation in Xcode using Carthage not working

I followed all the steps to import Zipfoundation in my project using Carthage but it doesn't work.我按照所有步骤使用 Carthage 在我的项目中导入 Zipfoundation,但它不起作用。 I can import Alamofire without issues using Carthage so I am guessing the first steps are right.我可以使用 Carthage 毫无问题地导入 Alamofire,所以我猜第一步是正确的。

Zipfoundation imports into the folder without issues. Zipfoundation 可以毫无问题地导入文件夹。 The main difference is that ZipFoundation mentions that the fetched project has to be integrated into your workspace by dragging ZIPFoundation.xcodeproj to Xcode's Project Navigator.主要区别在于 ZipFoundation 提到必须通过将 ZIPFoundation.xcodeproj 拖到 Xcode 的 Project Navigator 来将获取的项目集成到您的工作区中。

在此处输入图片说明

I dragged it in my project and nothing happened.我把它拖到我的项目中,什么也没发生。 So I drag the frameworks and added the information to the build phases like I did with Alamofire but still nothing.所以我拖动框架并将信息添加到构建阶段,就像我对 Alamofire 所做的那样,但仍然没有。

when I type "Import Alamofire" Alamofire shows up but nothing for "Import ZIPFoundation"当我输入“Import Alamofire”时,Alamofire 出现但“Import ZIPFoundation”没有显示

Is there a step I am missing?有没有我遗漏的步骤?

在此处输入图片说明

在此处输入图片说明

Adding dependencies as .xcodeproj can be a bit cumbersome because Xcode has the tendency to move the dragged-in file under an existing project.添加依赖关系.xcodeproj可有点麻烦,因为Xcode中有移动拖入的文件中的现有项目的趋势。
But to add a dependency to a workspace, the dragged in project should be a sibling and not a child of the consuming project.但要添加一个依赖于一个工作区,该项目拖应该是兄弟,而不是消费项目的一个孩子

3 Things are important for that to work: 3 事情对于它的工作很重要:

  • Your project must be part of an Xcode Workspace (it can be a workspace that for now only contains one single project)您的项目必须是 Xcode 工作区的一部分(它可以是目前仅包含一个项目的工作区)
  • ZIP Foundation has to be checked out via carthage update --no-build ZIP Foundation 必须通过carthage update --no-build检出
  • The project must be on the same level as the consuming project in the workspace:该项目必须与工作区中的消费项目处于同一级别:

在此处输入图片说明

You also don't need the "Copy Frameworks" script for ZIP Foundation when you integrate it with the method described above.当您将 ZIP Foundation 与上述方法集成时,您也不需要“复制框架”脚本。 The Carthage Build folder won't contain a binary framework when you use the --no-build option.当您使用--no-build选项时,Carthage Build 文件夹将不包含二进制框架。
Just make sure that ZIPFoundation.framework is in the "Embedded Binaries" list of your target.只需确保ZIPFoundation.framework位于目标的“嵌入式二进制文件”列表中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM