OpenSSL icon indicating copy to clipboard operation
OpenSSL copied to clipboard

[CocoaPods] Library not loaded

Open ferencIOS opened this issue 2 years ago • 2 comments

Hi all,

Error: dyld[18405]: Library not loaded: @rpath/OpenSSL.framework/OpenSSL Referenced from: /private/var/containers/Bundle/Application/85285A84-FB19-4C54-8DFF-3F990572BF3F/[app].app/IG YOU Reason: tried: '/usr/lib/swift/OpenSSL.framework/OpenSSL' (no such file), '/private/var/containers/Bundle/Application/85285A84-FB19-4C54-8DFF-3F990572BF3F/[app].app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/private/var/containers/Bundle/Application/85285A84-FB19-4C54-8DFF-3F990572BF3F/[app].app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/private/var/containers/Bundle/Application/85285A84-FB19-4C54-8DFF-3F990572BF3F/[app].app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/usr/lib/swift/OpenSSL.framework/OpenSSL' (no such file), '/private/var/containers/Bundle/Application/85285A84-FB19-4C54-8DFF-3F990572BF3F/[app].app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/private/var/containers/Bundle/Application/85285A84-FB19-4C54-8DFF-3F990572BF3F/[app].app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/private/var/containers/Bundle/Application/85285A84-FB19-4C54-8DFF-3F990572BF3F/[app].app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/System/Library/Frameworks/OpenSSL.framework/OpenSSL' (no such file)

OpenSSL Version 1.1.1700

Mac macOS Monterey 12.5.1, chip Apple M1

Devices iPhone 12 (but also Simulator throws the same error)

Dependency Manager CocoaPods

def shared_pods
  platform :ios, "10.0"
  inhibit_all_warnings!
  use_frameworks!

 [..]
  pod "OpenSSL-Universal", "1.1.1700"
end

ferencIOS avatar Sep 08 '22 09:09 ferencIOS

Hello @ferencIOS,

I've also found the same problem.

It's solved by adding the OpenSSL.xcframework to Embed Frameworks and then select Embed & Sign.

I wanted to track the issue and seems like this is something that has been introduced in the last version (1.1.1700). If you choose "1.1.1501" instead, it works like before. So another workaround would be to downgrade your version.

jorge3pp avatar Sep 14 '22 11:09 jorge3pp

I have the same problem.

erdincmaden avatar Sep 15 '22 11:09 erdincmaden

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 :

  1. Uninstall ruby gems sudo gem uninstall --all
  2. Remove workspace project, delete Podfile.lock
  3. Deleted the pods directory
  4. Install cocoapods sudo gem install cocoapods
  5. Run pod install

nagarro-mohitpadalia avatar Dec 04 '22 02:12 nagarro-mohitpadalia

I opened this issue, possibly related though I am using SPM: https://github.com/krzyzanowskim/OpenSSL/issues/162

paulosilva8 avatar Dec 06 '22 11:12 paulosilva8

I switched to 1.1.1900 adding these lines on Podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
[...]
      config.build_settings["CODE_SIGNING_ALLOWED"] = "NO"
    end
  end
end

ferencIOS avatar Dec 15 '22 19:12 ferencIOS

it looks like not something I suppose to change. Xcode default value changed between versions

Xcode 13 used to automatically set CODE_SIGNING_ALLOWED to NO by default for resource bundles. But that’s no longer the case in Xcode 14.

from https://blog.codemagic.io/code-signing-issues-in-xcode-14-and-how-to-fix-them/

krzyzanowskim avatar Feb 10 '23 11:02 krzyzanowskim