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
2
Answers
I found a solution that feels like a workaround:
Although this works, it would be nice to find an option that just works out of the box without any additional configuration. Now I have to revert those changes if I want to run on a simulator because the simulator will of course crash with the linked iPhone OpenSSL build
It is due to not OpenSSL library integrated properly
Solution 1:
Project settings
Select Target
Select the
General
tabUnder
Frameworks, Libraries and Embedded Content
, click on the plus button.Find the
OpenSSL.xcframework
from the list and hit Add.select
Embed and sign
fromOpenSSL.xcframework
run xcode build again
Solution 2:
pod install
in the ios root directorySolution 3:
For 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:
Then both debug and release builds worked for me. 👍🏼