2

I have tried to install SSZipArchive using Cocoapods, without success. I have several questions, and tried all solutions I found on StackOverflow to solve.

  1. Is Githut mandatory for installing this framework ? As told in the SSZipArchive webpage, I installed Cocoapods, dropped the SSZipArchive folder in the project and got no error after "pod install" within my project directory.
  2. After opening the workspace file, I still get a message that the frameworks can not be found. Framework names are in red. I tried to change the framework path ($(inherited), $SRCROOT, both recursive), without success
  3. Why isn't is JUST possible to compile the SSZipArchive.framework file and include it in the Libraries or in the project. Is it mandatory to use Cocoapods?

How to install SSZipArchive (or any other framework), without link error?

Cœur
  • 37,241
  • 25
  • 195
  • 267
philippe
  • 1,877
  • 2
  • 20
  • 25

2 Answers2

4

Try This.

If you have already tried and fail to have proper file then do this, Remove line pod 'SSZipArchive' from Pod file and run "pod install", it will remove previously stored buggy files.

Now your Pod file should be like below :

# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'ZIpArchive' do

pod 'SSZipArchive'

end

Run pod install

open your project.xcworkspace, Where ever you want to use SSZiparchive methods.

In Objective-C

use "#import "ZipArchive.h"

Then after you can use the class methods of SSZipArchive like this.

[SSZipArchive createZipFileAtPath:@"" withContentsOfDirectory:@"" withPassword:@""];

In Swift

import SSZipArchive

Then after you can use class method like this

SSZipArchive.createZipFileAtPath("", withContentsOfDirectory: "")
Wolverine
  • 4,264
  • 1
  • 27
  • 49
  • Thank you for this response. This allows reset of the pods. I could run my software by putting the podfile file besides the xxx.xcodeproj file (same directory), deleting the "Pods" and "Frameworks" directory from the Xcode project, then deleting the podfile.lock and Pods/ directory. Then, I did the new "pod install" procedure, as above. However, this did not solve the problem of having "Foundation.framework", "SSZipArchive.framework" directories in RED in the XCode project. But it runs... I can't understand. – philippe May 20 '16 at 17:12
  • Also, I still have no idea on how to simply compile and add a framework to my project if I don't care about its potential dependencies and want to get rid of that f....g cocoapods... That should be possible – philippe May 20 '16 at 17:14
  • Cocoa pod is good when we use open source which are getting updated on regular basis. If you are not find yourself comfortable with cocoa-pod, you can do it also by manually copy and paste files. Every good library describe number of ways to use them in project. – Wolverine May 22 '16 at 12:15
  • Go to https://github.com/iosphere/ssziparchive download code from GITHUB. 1. Add the SSZipArchive and minizip folders to your project. 2. Add the libz library to your target If you follow above steps you can have SSZipArchive in your project.. – Wolverine May 22 '16 at 12:18
  • thank you very much+. That looks simple, but I passed through that...Initially, I tried to install the files like this, got errors, but libz was not linked. During all these cocoapod problems, I figured out how to define libz, and although it is still stuck on my MacBook, it works correctly with on another mac (source code is shared through a Dropbox), so I won't touch anything. I only use one external library, so in case I still get issues at time of release, I'll follow your explication. Thanks for your help. – philippe May 22 '16 at 13:52
  • Thank you very much @Wolverine, followed your steps precisely and it worked. – James Selvakumar May 10 '21 at 01:57
0

I did exactly same as what @Wolverine listed down at his comment, but the link error was still appearing until...

I added $(inherited) to both "Runpath Search Paths" and "Frameworks Search Paths" in Build Settings..

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Alfred
  • 1
  • 2