I have a react-native app that consumes OpenSSL-Universal as dependency.
OpenSSL is being called from CPP Code which is bridged via an react-native swift library. In the Simulator the whole code runs fine. But when I build the App for production, Archive it in X-Code and install it on a real i-Phone, I get following error:
DYLD error: Library not loaded: @rpath/OpenSSL.framework/OpenSSL
I have added the OpenSSL.framework
to Targets -> Build Phases -> Link Binary with Libraries and to
General -> Frameworks, Libraries, and Embedded Content
What am I missing here? Its really confusing to me that it runs fine on the Simulator, but not on a real device
It is due to not OpenSSL library integrated properly
Project settings
Select Target
Select the General
tab
Under Frameworks, Libraries and Embedded Content
, click on the plus button.
Find the OpenSSL.xcframework
from the list and hit Add.
select Embed and sign
from OpenSSL.xcframework
run xcode build again
pod 'OpenSSL-Universal', :modular_headers => true, :configurations => ['Release']
pod install
in the ios root directoryFor whatever reason in Project settings > Select Target > Build Settings > Framework Search Paths
this:
but the Release ones were missing a bunch of those so I added these 2:
"${PODS_ROOT}/OpenSSL-Universal/Frameworks"
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal"
Then both debug and release builds worked for me. 👍🏼