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
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 DYLDSHAREDCACHEDIR=/Users/deepesh.vasthimal/Library/Developer/CoreSimulator/Caches/dyld/19H2/com.apple.CoreSimulator.SimRuntime.iOS-14-0.18A372 DYLDROOTPATH=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/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 DYLDINSERTLIBRARIES=/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.
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
guard let aesObject = try? AES(key: [UInt8](Data()),
blockMode: CBC(iv: Array(Data())),
padding: .pkcs7) else { return "" }
Adding below script to end of pod file of the client app.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
and then run the pod commands
pod deintegrate
pod install
and fixes the crash.