Import CommmonCrypto library to Swift project

253 views Asked by At

I am using CommonCrypto library in my swift class:

import CommonCrypto

It is working and when I am building my project in Xcode it's ok. I have uploaded my code to repository using git. When I clone this code and try build archive with command:

xcodebuild -project PNG.xcodeproj -scheme PNG -sdk iphoneos -configuration AppStoreDistribution archive -archivePath $PWD/build/PNG.xcarchive

I get error:

....swift:38:8: error: no such module 'CommonCrypto'

What's wrong? How can I fix this? Why in my local project it's working and with project clone from repository it's not? Thanks for help

1

There are 1 answers

2
zaph On

You need to add #import <CommonCrypto/CommonCrypto.h> to the bridging header and include the Security.framework in the project.