OpenSSL not found in the linked frameworks
paulosilva8 opened this issue · 5 comments
I used to have a private repo with openSSL and distribute it using cocoapods. We are moving to SPM, so I found your repo and integrated it successfully thus far.
However, one embedded library in our app is also requesting openSSL to build and I am getting the following error:
dyld: Library not loaded: @rpath/openssl.framework/openssl Referenced from: .../Build/Products/Debug-iphonesimulator/ffmpeg.framework/ffmpeg Reason: image not found dyld: launch, loading dependent libraries
It seems the SPM integration provided with openSSL is a library (not dynamic?) and the framework is either placed in a different folder with SPM or has a different name?
Looks like issue happens because of an older version of ruby gem used by cocoapods, updating the cocoapods does not update some dependencies. So the steps I performed to resolve this are :
- Uninstall ruby gems
sudo gem uninstall --all
- Remove workspace project, delete
Podfile.lock
- Deleted the pods directory
- Install cocoapods
sudo gem install cocoapods
- Run
pod install
It must be some other problem as this didn't help to fix the issue. Thanks
Looks like issue happens because of an older version of ruby gem used by cocoapods, updating the cocoapods does not update some dependencies. So the steps I performed to resolve this are :
- Uninstall ruby gems
sudo gem uninstall --all
- Remove workspace project, delete
Podfile.lock
- Deleted the pods directory
- Install cocoapods
sudo gem install cocoapods
- Run
pod install
I had also this issue on another project with SPM.
I guess you, @paulosilva8, have a structure like this:
App
---> Embed Custom Framework
--------> Custom Framework embed OpenSSL via SPM
If the assumption is right what I did is:
App
---> Embed Custom Framework **+ OpenSSL via SPM** (*)
--------> Custom Framework embed OpenSSL via SPM (*)
(*)using the same version for the App and the Custom Framework
Why?
- SPM generates a sort of static lib
- OpenSSL is a xcframework
So you need to embed the xcframework in the App level.
Maybe @krzyzanowskim an attempt could be
targets: [
.binaryTarget(
name: "OpenSSL",
url: "<OpenSSL-URL>",
checksum: "<OpenSSL-Checksum>"
)
]
instead of
targets: [
.binaryTarget(
name: "OpenSSL",
path: "Frameworks/OpenSSL.xcframework"
)
]
Have a nice evening!
Problem with this approach is only that the embed framework is managed by another company. I have requested a new binary to point to the correct framework and yes, it should fix the issue
url: "<OpenSSL-URL>", checksum: "<OpenSSL-Checksum>"
Xcode is (was) quite broken when it comes to downloadable SPM artifacts last time I checked