简体   繁体   中英

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. I can import Alamofire without issues using Carthage so I am guessing the first steps are right.

Zipfoundation imports into the folder without issues. 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.

在此处输入图片说明

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.

when I type "Import Alamofire" Alamofire shows up but nothing for "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.
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:

  • Your project must be part of an Xcode Workspace (it can be a workspace that for now only contains one single project)
  • ZIP Foundation has to be checked out via 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. The Carthage Build folder won't contain a binary framework when you use the --no-build option.
Just make sure that ZIPFoundation.framework is in the "Embedded Binaries" list of your target.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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