I need to implement ZIP file and directory compression without using any third party libraries and Apple Archive looks like it would do the trick. Unfortunately, whenever I try to make use of it (yes, I did import it), I get out of scope errors.
The Swift import headers are all essentially empty in the Xcode 12.2 beta. The Objective C headers exist, though.
Before I put any more time into this, does anyone know if/when Apple Archive will be implemented as documented? Has it been pulled from the SDK but the documentation not updated? I'm a little worried about trying to use the Objective C variant because I cannot find anything on the status of the framework in general.
Thanks,
Kevin
The Archive Framework implements compression algorithms and supports for example the LZMA compression format.
Unfortunately I was not able to find a way to generate a ZIP-kompatible archive using the Archive Framework though iOS / iPadOS seems to be able to do that, because the Files app and the Shortcuts app support this kind of compression.
Is there a way on iOS/iPadOS to generate an LZMA compressed archive with ZIP container using only apple provided APIs or other system services?
PS: I don't need full support for all possible ZIP features. I only need to create a simple archive containing some files which can be opened using any zip decompression program.
https://developer.apple.com/documentation/accelerate/compressing_file_system_directories
Running the latest Mac OS beta. I have downloaded the image twice but same result.
The error from the command line is:
xip: error: The archive “Xcode_13_Release_Candidate.xip” is damaged and can’t be expanded.
The error when using the Archive Utility is about not enough space but I have more than 100GB available.
Restarting the Mac doesn't help.
Post not yet marked as solved
I'm currently trying to decompress a received .zip file from the backend and while researching I found the native library called AppleArchive. I've imported the library and tried the code described here but I get the following error:
Also if i go into the library itself only one method shows up:
public func __assert_rtn(_: UnsafePointer<CChar>!, _: UnsafePointer<CChar>!, _: Int32, _: UnsafePointer<CChar>!) -> Never
Tested on Xcode 13.2 on a project with minimum deployment of iOS 15.0
Edit
Tested it again by changing the build target to be a real device and it works!
Questions:
Can this library be used to unarchive .zip files?
How can AppleArchive be used on a simulator device?
There are files that fail to decompress on Mac or iOS.
Even using open source for iOS, they all fail.
Clicking on the MacBook to open it fails.
However, some compression programs on Mac or PC will successfully decompress it.
Is there any way to forcefully open or decompress such a compressed file (Zip)?
I tried the Apple Archive method, but that method also fails with an error now.
(Personally, I would like to be able to force such a file through the Apple archive.)
Post not yet marked as solved
3 questions on the AppleArchive.h APIs:
Are there Obj-C APIs? I see Swift APIs but I'm not looking forward to using them.
Is there sample code showing how to use the C APIs?
Is there any plan to fix the documentation on Apple Developer web page for this library? It's not really useful right now and the CSS is broken for sample code (the sample code frame is clipping code on the right). Same problem with the Compression documentation.
Post not yet marked as solved
I built a MacOs app, and it works fine, but the problem happens when I achieve the project. When I tried from an old Xcode version (12.3) Macbook Pro late 13 it works But when I run from Macbook pro-2020 (M1 chip), the issue happened while archiving, and works fine while running, I use Xcode 14 beta.
The app is written in objective-c
I get this error:
/Users/usamafouad/Downloads/Oil Paint - Mac/Oil Paint App/frameworks/Source/Mac/GPUImageMac-Prefix.pch error build: Build input file cannot be found: '/Users/usamafouad/Library/Developer/Xcode/DerivedData/Oil_Paint-dywawlmfpsulhqapvsuiigxhgkrs/Build/Intermediates.noindex/ArchiveIntermediates/Oil Paint/InstallationBuildProductsLocation/@loader_path/../Frameworks/GPUImage.framework/Versions/A/Modules/module.modulemap'
Could you please help me, it's an urgent issue?