kylef / JSONWebToken.swift

Swift implementation of JSON Web Token (JWT).
http://jwt.io
BSD 2-Clause "Simplified" License
763 stars 226 forks source link

Missing required module 'CommonCrypto' #92

Closed ivopintodasilva closed 6 years ago

ivopintodasilva commented 6 years ago

On Xcode 9, when installing the library through Carthage I get the following error when building my project:

"Missing required module 'CommonCrypto'".

However, on my development computer, this error does not appear. The only difference I noticed is that on my own computer I have the "Checkouts/JSONWebToken" folder that contains the modulemap for CommonCrypto. In my CI computer, I don't have the "Checkouts" folder so the modulemaps are not present.

Is there any possible fix for this?

ivopintodasilva commented 6 years ago

Fixed.

I removed the "import JWT" from the file where I'm using it and now it builds and works properly. However, I didn't understand why this is happening.

TinyBun commented 6 years ago

I'm having a similar issue where my CI fails with an error: missing required module 'CommonCrypto' but my development computer works fine.

Removing the "import JWT" line didn't work for me, it's just giving me errors of use of undeclared types.

ivopintodasilva commented 6 years ago

Turns out that I wasn't using the library in the project and forgot to clean it. But it's an odd error to have, I couldn't understand why it was happening on my CI and not locally...

TinyBun commented 6 years ago

@IvoPintodaSilva Thanks for the update.

With that being said, this issue is not really fixed and closed then...

@kylef Can we get this sorted out?

kylef commented 6 years ago

As per the Carthage nested dependencies documentation, you will need to add the CommonCrypto framework to your project.

If the embedded framework in your project has dependencies to other frameworks you must link them to application target (even if application target does not have dependency to that frameworks and never uses them).

TinyBun commented 6 years ago

As per the Carthage nested dependencies documentation, you will need to add the CommonCrypto framework to your project.

If the embedded framework in your project has dependencies to other frameworks you must link them to application target (even if application target does not have dependency to that frameworks and never uses them).

I'm sorry if I'm asking a dumb question, but how exactly should I add the CommonCrypto framework to my swift project in this case?