1

I am trying to embed CryptoSwift as an embedded framework into a Watch app (watchOS3) - I would like to be able to use AES encryption and decryption from within the Watch app.

I start by creating a new clean Xcode project: watchOS application using "iOS App with WatchKit App" in a local git repository.

To add CryptSwift, I followed the installation guidance of CryptoSwift (https://github.com/krzyzanowskim/CryptoSwift#installation) by adding it as a git submodule (git submodule add https://github.com/krzyzanowskim/CryptoSwift.git) on the top level project folder. Then I dragged the CryptoSwift.xcodeproj into the clean Xcode project.

Then, I add the CryptSwift.framework into the Embedded Binaries of the iOS app target. Build was successful, and I could use import CryptoSwift, e.g., in ViewController.swift.

But when I add the CryptSwift.framework into the Embedded Binaries of the WatchKit Extension target. Hits Build, it fails: "clang: error: no such file or directory: '/Users/brian/Library/Developer/Xcode/DerivedData/TestCrypto2-bkzbizyfkacuctdwdngnvcrrewpi/Build/Products/Debug-watchsimulator/CryptoSwift.framework/CryptoSwift'". And I am not able to use import CryptoSwift in e.g. InterfaceController.swift in the WatchKit Extension.

I have tried a number of different approaches to add the CryptoSwift.framework to the WatchKit Extension, but none with success.

Does anyone know how to add this CryptoSwift framework to the WatchKit Extension the right way, if possible?

  • Xcode 8.1 (8B62)
  • iOS 10.1
  • watchOS 3.1
jww
  • 97,681
  • 90
  • 411
  • 885

0 Answers0