0

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

Libor Zapletal
  • 13,752
  • 20
  • 95
  • 182

1 Answers1

1

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

zaph
  • 111,848
  • 21
  • 189
  • 228
  • I fix it by removing `import CommonCrypto` but without it I get errors when using enums from CommonCrypto so I must replace them with int values. – Libor Zapletal Jan 07 '17 at 12:17
  • Do not replace the Common Crypto values with int values, cast them to the correct type. – zaph Jan 08 '17 at 12:42