-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clibsodium cannot be Product > Archived #226
Comments
I've added the test project here: https://github.com/JakobOffersen/Sodium-Product-Archive-Issue The issue is also present on XCode 12.2 |
Unfortunately I wasn't able to reproduce this (tried with the default iOS template, deployed for generic iOS platforms).
Maybe you are trying to archive for simulators instead of actual devices? |
To be specific, I'm able to make an archive-build, but the problem appears when I try to distribute it - even for the simplest dummy-project. And I make sure to add both Did also try out the fork from #233 but with no luck. Not really sure, what goes wrong though... Are you able to distribute your archived build (ad-hoc/to appstore connect etc)? |
I've made a small screencast of the issue. Sodium.Archive.Issue.mov |
@JakobOffersen Just btw, it may help: I am using Sodium 0.9.1, with XCode 12.3 and I was able to archive the product. Cocoapod has to be 1.10+ ( |
The issue happens because some component (SPM?) copies libsodium.a into the target's Frameworks directory. That is complete nonsense, because libsodium.a is linked statically. The archive tool's logs reveal that this is indeed the issue:
You can review your own logs by building an archive via I have not yet found a workaround. It does not seem to be possible to solve this with a build phase, because libsodium.a is copied after the last build phase runs: |
It seems to work by adding a script as 'Post-action' for Archive in the build scheme:
I also provide libsodium for my app extensions, if you don't, you may need to adjust / remove the last 4 lines. |
I encountered the same problem when settings up the following minimal example:
When trying to archive the project compiling Aead.swift fails on importing Clibsodium: "No such module 'Clibsodium'" I tried the workaround @bas-d suggested but that didn't solve the issue. |
I had the same issue. For me the solution was to separate Clibsodium into its own package and set it as a dependency in the Sodium Package.swift file. This also allows the Sodium package to be reduced to only the .swift files in the Tests, Sodium and Sodium/Generators directories simplifying the entire package. |
Yes, for me it also only works with the separate CLibsodium package from #235. This seems to fix the The post-action script fixes the SPM bug that copies the libsodium.a into the framework directory, which causes errors when validating or distributing. However, this comment indicates that this issue is fixed in Xcode 12.5, but I haven't verified that. |
I guess we need to rely on the workaround with two separate repositories until this bug gets fixed: https://bugs.swift.org/browse/SR-13803 |
@JakobOffersen |
Xcode 12.5, 12.5.1, and the workaround suggested above all still break the first build for me. 😭 I haven't tried archiving, however. That might be improved one place or another. |
Hi
Description:
When making a
Hello World
-project and importingSodium
andCLibsodium
according to the README, the project builds as expected. However, when I doProduct > Archive
, I get aIPA processing failed
error. The attached log includes the following description, which may be relevant:"Couldn't find platform family for "libsodium.a".
Thus I cannot distribute an app which uses
Sodium
Details
Reproduction Steps
Sodium
andClibsodium
as dependencies according to the docs. Added below for convenience:"To add Swift-Sodium as dependency to your Xcode project, select File > Swift Packages > Add Package Dependency, enter its repository URL: https://github.com/jedisct1/swift-sodium.git and import Sodium as well as Clibsodium."
Product
>Archive
Distribute App
, then chooseAd Hoc
thenNext
After these steps I end up with an error prompt saying IPA processing failed.
The corresponding log is attached below.
IDEDistribution.standard.log
Anyone who ran into the same issue and knows how to resolve it?
And is this an XCode issue or an Clibsodium issue?
The text was updated successfully, but these errors were encountered: