Skip to content
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

No such module 'Clibsodium' Xcode 12 #212

Closed
marwan87 opened this issue Sep 30, 2020 · 13 comments
Closed

No such module 'Clibsodium' Xcode 12 #212

marwan87 opened this issue Sep 30, 2020 · 13 comments

Comments

@marwan87
Copy link

marwan87 commented Sep 30, 2020

Hi

is anyone else seeing this issue?

on Xcode 12 and Xcode 12.0.1.

I get " No such module 'Clibsodium'" when I build and Archive

"SourcePackages/checkouts/swift-sodium/Sodium/Aead.swift:2:8: No such module 'Clibsodium'
import Clibsodium"

Im using swift package manager

Things ive tried adding, adding Exclude Archs, adding valid Archs.

I tried release 0.8.0, that doesn't have that issue but has other issues to do with x86.

@jedisct1
Copy link
Owner

In the Choose package products and targets dialog, you need to check both Sodium and Clibsodium.

The documentation originally said that Clibsodium was not necessary, because it isn't for the Build operation, but it apparently is for archival.

@marwan87
Copy link
Author

marwan87 commented Sep 30, 2020

Hi did try that.
But was still getting the error, anything else I can try?

Thank you for your quick response by the way.

@jedisct1 jedisct1 reopened this Oct 1, 2020
@marwan87
Copy link
Author

marwan87 commented Oct 1, 2020

Ive just double checked, cleaned all builds, deleted packages, deleted derived data and rebuilt, its still crashing out on

/swift-sodium/Sodium/Aead.swift:2:8: error: no such module 'Clibsodium'
import Clibsodium

Anything I can do to help debug the issue?

@zacwest
Copy link
Contributor

zacwest commented Oct 3, 2020

I've spent a decent amount of time investigating this (filed as FB8743041 but probably many others exist) and I believe this is an Xcode bug around importing any Swift Package Manager dependencies into a non-app target; that is, if it's a transitive dependency it's probably going to be a problem. GRDB also has reported similar issues.

Adding Clibsodium in addition to Sodium makes it (significantly) more likely to work, but I believe its success is nondeterministic. However, rebuilding until it succeeds will likely make it continue to succeed until you clear your build folder.

Switching to Cocoapods (once the xcframework works with it) is probably the best bet to this not being a frustrating experience.

@jedisct1
Copy link
Owner

jedisct1 commented Oct 3, 2020

Hi,

Can you add a link to the relevant post you opened on the Apple Developer forums?

Thanks!

@zacwest
Copy link
Contributor

zacwest commented Oct 3, 2020

I haven't posted on the forums -- just filed a "feedback" (née Radar).

@marwan87
Copy link
Author

marwan87 commented Oct 5, 2020

Hi Guys
Thanks for the clarification, @zacwest I did try the archive multiple times and that did not work at all, I can build it though, after the first failure.

I spent 2 days removing all pods from the project but may have to go back to it.

Ive tried it on the Xcode 12.2 and that still has the same issue.

In the project, I do have a watch target and a widgets target and that may have something to do with it. I have made sure all the appropriate settings in the build are ticked, ive also excluding x86 and others but still all fails.

I may try using sodium by manually importing and see if that solves the issue.

By the way thanks for the help

@marwan87
Copy link
Author

marwan87 commented Oct 5, 2020

Manually importing the project works, so I will just use that until apple get their sh**t together and fix the issue, thanks guys

Im currently building in Xcode 12 and archiving, all fine, but then sending to the App Store im doing via 11.7 as Xcode 12 gives me issues

@JakobOffersen
Copy link

Running into the same issue. @marwan87 could you please describe in a bit more detail what you did to resolve it? What did you do to "manually import the project"?

@andreas-bergstrom
Copy link

I am also running into this issue when using Swift Package Manager. And I want/need to use SPM to get my repo building on CI/CD (Appcenter).

@JakobOffersen using the Sodium.xcodeproj and draging it into your app project usually works.

@JippeJoosten
Copy link

I had the same problem, the solution that I found is to add them as a dependency in your target.

dependencies: [
    .product(name: "Sodium", package: "Sodium"),
    .product(name: "Clibsodium", package: "Sodium")
]

@Esakkiraja-Pothikannan
Copy link

I had the same problem, the solution that I found is to add them as a dependency in your target.

dependencies: [
    .product(name: "Sodium", package: "Sodium"),
    .product(name: "Clibsodium", package: "Sodium")
]

I had the same problem, How should i add this to my target?

@zacwest
Copy link
Contributor

zacwest commented May 21, 2021

Apple followed up to my Feedback that they believe this issue is resolved in Xcode 12.5. I have not tested it since I am once again using Cocoapods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants