Socket.io-client-swift: Missing required modules: 'CommonCrypto', 'zlib'

Created on 25 Jul 2017  ·  30Comments  ·  Source: socketio/socket.io-client-swift

I update the library and I found this error. Can you help me?

bug patched

Most helpful comment

Should be fixed in 11.1.2

All 30 comments

What version of the lib?

And how did you install the lib?

Last version with pod

Have you done a repo update and pod update? I tested CocoaPods myself and it worked fine.

I updated pod to the latest beta version. I came back to the previous version that works correctly.

Same problem here after library update to Socket.IO-Client-Swift 11 (was 10.0.1).

schermata 2017-07-28 alle 00 49 05

What other dependencies are you using? I wonder if they're conflicting.

This:

  pod 'Alamofire', '~> 4.5'
  pod 'PromiseKit', "~> 4.2"
  pod 'KeychainAccess', '~> 3.0.1'
  pod 'IQKeyboardManagerSwift', '~> 4.0'
  pod 'SwiftyBeaver', '~> 1.3'
  pod 'MGSwipeTableCell', '~> 1.5'
  pod 'DZNEmptyDataSet', '~> 1.8'
  pod 'SideMenu', '~> 2.3'
  pod 'Jibber-Framework', '~> 2.0', :configurations => ['Debug']
  pod 'Fabric'
  pod 'Crashlytics'
  pod 'PullToRefresher', '~> 2.0'
  pod 'OneSignal', '>= 2.5.2', '< 3.0'
  pod 'ObjectMapper', '2.2.7'
  pod 'Kingfisher', '3.10.2'

Hm, yeah. I wonder if there's a way to figure out which one is causing the conflict... I'm also not sure the best way to solve this issue.

I'm guessing I'll have to change the names of these modules in my fork of Starscream.

I'm having this issue too - I get the same build error as Codeido has above since updating to Socket.io 11.0. I only have one dependency aside from socket.io and Starscream, and that dependency (Polyline) doesn't use CZLib or CommonCrypto.

(I should also note that I'm using Carthage, not Cocoapods)

I was above to work around this issue by moving Carthage/Checkouts/Starscream/zlib/module.modulemap from my project directory to a different location. Now it no longer complains - which is weird, since I'm using the frameworks from the Build directory and don't have the Checkouts projects loaded in Xcode. If I move the whole Checkouts directory somewhere else I get an error complaining that CZLib and CommonCrypto cannot be found.

Any idea what is going on here? I see why this would happen with dependencies that use CZLib or CommonCrypto, but mine don't...

I had the same problem as @Codeido. I followed the technique described in Mike Weller's answer here:
https://stackoverflow.com/questions/25248598/importing-commoncrypto-in-a-swift-framework

He creates a target called CommonCryptoModuleMap which fixes the redefinition problem for CommonCrypto. I followed the same technique to create a CZLibModuleMap, with this for my Run Script:

mkdir -p "${BUILT_PRODUCTS_DIR}/zlibModuleMap"
cat < module zlib [system] {
header "${SDKROOT}/usr/include/zlib.h"
export *
}
EOF

After this my project built and I was successfully able to connect to my socket.io server running locally.

This might have been fixed in 11.1.0.

It doesn't seem to be fixed. I still get the "Redefinition of module" errors when building with 11.1.1 and StarscreamSocketIO 8.0.4. I'm using Carthage for my dependency resolution, and I cleared the Carthage directory before the rebuild to make sure there were no residual files. I can work around this problem by deleting the Carthage/Checkouts/Starscream/zlib/module.modulemap file - then the build error goes away.

@thully @tbaranes Can you see if just adding the development branch of socket.io to your Cartfile and building fixes it? I'm trying something out.

From my testing it seems to be fixed. But knowing how package managers play with each other, I'll probably break everything else.

has anyone got this to work?

(update)...got it to work. cleaning build folder...not sure what's going on w/ xcode

@nboyd-sportdx were you using Carthage or cocoapods? If carthage did you use the development branch?

@nuclearace I have the same issue with the following cartfile:

github "nuclearace/Starscream" ~> 8.0.4
github "socketio/socket.io-client-swift" ~> 11.1.1

@LeonidKokhnovich Try github "socketio/socket.io-client-swift" "development"

If that works I can make a new release.

@nuclearace Thank you for such a fast support with the problem. Yes, it fixes the issue with the following cartfile update:

github "nuclearace/Starscream" ~> 8.0.4
github "socketio/socket.io-client-swift" "development"

this is working for me as well

I'll make a new release tonight then.

i'm notorious for cutting corners and not RFTM. if you can get another test case/subject before doing a release...that may help. sorry for any inconvenience and thank you for your hard work

@Nathan187 What do you mean?

just wondering if it was something i was doing wrong....but i'll drop the subject now. thanks for your hardwork

Should be fixed in 11.1.2

Still facing issue with cocoapods :(
pod 'Socket.IO-Client-Swift', '~> 11.1.3'
pod 'Starscream', '~> 3.0.3'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

huangxiaolin0425 picture huangxiaolin0425  ·  6Comments

jetricy picture jetricy  ·  5Comments

MihaelIsaev picture MihaelIsaev  ·  6Comments

janiduw picture janiduw  ·  5Comments

MD04-TanTan picture MD04-TanTan  ·  5Comments