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

Redefinition of module 'CommonCrypto' #361

Closed
ChristianSteffens opened this issue Jul 18, 2017 · 10 comments · Fixed by #364
Closed

Redefinition of module 'CommonCrypto' #361

ChristianSteffens opened this issue Jul 18, 2017 · 10 comments · Fixed by #364

Comments

@ChristianSteffens
Copy link

ChristianSteffens commented Jul 18, 2017

Hi,

I'm using your framework in combination with several others - including CommonCrypto. Unfortunately both frameworks - Starscream and CommonCrypto - are using the system CommonCrypto framework.

This results in a duplication error in the modulemaps:
.../Starscream/zlib/module.modulemap:6:8: Redefinition of module 'CommonCrypto' ... .../CommonCrypto.framework/Modules/module.modulemap:1:8: note: previously defined here module CommonCrypto [system] { ^

I'm not sure what the appropriate fix for this problem is - #353 seems to address a similar issue. Renaming the module name CommonCrypto will probably work, but is this a clean solution?

Here's a link to the CommonCrypto's modulemaps - I searched for a related issue there, but found nothing.

In a carthage-only scenario I would remove Starscream' s dependency of the CommonCrypto (System) framework and would replace it with an appropriate entry for the cartfile - but since your framework should be usable outside carthage this is not an ideal solution.

Any ideas how to fix this - for all environments?

I posted the issue as well in CommonCrypto's issue section.

@daltoniam
Copy link
Owner

Yeah I can see how that would be a problem. The "best" solution would be unity on a common repo or a first party solution, but realistically that will probably create different conflicts 😄. Anyway, we might just be able to rename the CommonCrypto module in the module map to something "namespaced" for Starscream to avoid the conflict (e.g. SSCommonCrypto). This of course would require changing the SPM back to a custom repo since the import name would now be different. Yeah, I don't love our options, but not sure how else to get other frameworks with the same dependencies to play nice.

@nuclearace
Copy link
Contributor

@daltoniam Yeah I'm running into this issue on my fork. I it's acceptable to go back to custom repos and wait for a first-party solution.

@ChristianSteffens
Copy link
Author

Latest release is working - thank you.

@rhishikeshj
Copy link

@daltoniam Hi, so my setup is the following

I have a framework A which is linking to Starscream via Cocoapods. I can build this framework correctly.
Now I link this framework with an App. If I just build, I get an error saying Starscream not found. So I add the Starscream dependency via Cocoapods. Now when I build, it gives me and error saying
/Users/mjolnir/workspace/oss/LiveGQL/Example/Pods/Starscream/zlib/module.modulemap:1:8: error: redefinition of module 'SSCZLib' module SSCZLib [system] { ^ /Users/mjolnir/workspace/oss/LiveGQL/Pods/Starscream/zlib/module.modulemap:1:8: note: previously defined here module SSCZLib [system] { ^ /Users/mjolnir/workspace/oss/LiveGQL/Example/Pods/Starscream/zlib/module.modulemap:6:8: error: redefinition of module 'SSCommonCrypto' module SSCommonCrypto [system] { ^ /Users/mjolnir/workspace/oss/LiveGQL/Pods/Starscream/zlib/module.modulemap:6:8: note: previously defined here module SSCommonCrypto [system] { ^ <unknown>:0: error: could not build Objective-C module 'Starscream'

Can you please help me out ?

@marconvcm
Copy link

I am facing the same issue @rhishikeshj did mention above.

@andrewtheis
Copy link

andrewtheis commented May 18, 2018

I'm getting the same issue w/Xcode 9.3. It's odd that it's looking in the Checkout directory ...

...Carthage/Checkouts/Starscream/zlib/module.modulemap:1:8: error: redefinition of module 'SSCZLib'
module SSCZLib [system] {
       ^
...Carthage/Checkouts/SwiftPhoenixClient/Example/Pods/Starscream/zlib/module.modulemap:1:8: note: previously defined here
module SSCZLib [system] {
       ^
...Carthage/Checkouts/Starscream/zlib/module.modulemap:6:8: error: redefinition of module 'SSCommonCrypto'
module SSCommonCrypto [system] {
       ^
...Carthage/Checkouts/SwiftPhoenixClient/Example/Pods/Starscream/zlib/module.modulemap:6:8: note: previously defined here
module SSCommonCrypto [system] {

@juancazalla
Copy link

Same issue here :(

@ddengler
Copy link

Same issue here with https://github.com/davidstump/SwiftPhoenixClient

@machive
Copy link

machive commented Oct 11, 2018

I'm having problems with this as well. My problem seems to be related to using Starscream and CryptoSwift together. I had a version of this working, but pulling my code fresh from Git no longer builds, as it cannot find SSCommonCrypto. I guess I fixed it somehow, way back when, but no longer know what I did to make it work.

My fresh pull from Git does not have an updated module map in Starscream for SSCommonCrypto and it is missing the zlib directory that was in the version that worked.

I'm totally confused, lol. Any help would be appreciated. Thanks.

@sirghi
Copy link

sirghi commented Nov 8, 2018

Same error here. It got fixed by removing the Starscream.framework from the Carthage build folder, try to build, then put it back, and built again successfully this time (shrug). Don't know what mystery tripped Xcode.

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

Successfully merging a pull request may close this issue.

10 participants