Custom Framework : dyld: Symbol not found: _$s11CryptoSwift7PaddingO5pkcs7yA2CmFWC

Hi All

I am using a custom framework created using 3 different cocoapods. I am using this custom framework in a client app by dropping the xc framework created. As soon as the client app launches it crashes with below crash logs. I have seen this issue reported many other places on apple and stackoverflow but i could not find a proper answer which worked for me. Now i have uploaded both the client app and the framework repo to github so that anyone trying to help me can actually see the set up and code. Please can any one suggest a proper solution to this issue.

Framework : https://github.com/deepesh259nitk/PaymentsKit
Client App : https://github.com/deepesh259nitk/PaymentClient

Crash Logs on app launch

Code Block
dyld: Symbol not found: _$s11CryptoSwift7PaddingO5pkcs7yA2CmFWC
 Referenced from: /Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator/PaymentsKit.framework/PaymentsKit
 Expected in: /Users/deepesh.vasthimal/Library/Developer/CoreSimulator/Devices/A0876375-98D5-4215-A139-68F29E787388/data/Containers/Bundle/Application/D954732B-EDDC-478E-85C4-C5C9B14FDDEE/PaymentClient.app/Frameworks/CryptoSwift.framework/CryptoSwift
 in /Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator/PaymentsKit.framework/PaymentsKit
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/deepesh.vasthimal/Library/Developer/CoreSimulator/Caches/dyld/19H2/com.apple.CoreSimulator.SimRuntime.iOS-14-0.18A372
DYLD_ROOT_PATH=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
DYLD_LIBRARY_PATH=/Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/de


Things which I have tried.
  1. I tried removing the CryptoSwift completely to see if the error happens due to this pod, but the crash then comes to JOSESwift which is another pod.

  2. I have realised the crash happens as it cannot find specific symbols both in CryptoSwift and JOSESwift. And also when i use specific methods of these libraries.

for example if i use the AES method of CryptoSwift if you see my repo for framework, by adding the below code the crash happens, Just including the pod does not crash but usage of it produces the crash.

_$s11CryptoSwift7PaddingO5pkcs7yA2CmFWC

Code Block
guard let aesObject = try? AES(key: [UInt8](Data()),
                   blockMode: CBC(iv: Array(Data())),
                   padding: .pkcs7) else {
      return ""
    }

3. I am also adding the pods in the client app so that it does not get added twice if you see Client App repo you will see all the 3 pods are added.

Replies

I'm having a similar issue, did you ever figure out the problem?