OpenSSL-Pod icon indicating copy to clipboard operation
OpenSSL-Pod copied to clipboard

Other pods can't use this pod as a dependency.

Open cjcaufield opened this issue 9 years ago • 14 comments

Since Cocoapods 0.36, podspecs generate frameworks and require their dependencies to also be frameworks. However, the OpenSSL pod isn't built as a framework.

There is an article about this change here: https://blog.cocoapods.org/CocoaPods-0.36/

Have you heard about this issue? Any ideas? Thanks.

cjcaufield avatar Mar 14 '16 22:03 cjcaufield

Specifically, when running pod lib lint on a podspec that depends on the OpenSSL pod, the following error is given:

- ERROR | [iOS] unknown: Encountered an unknown error (

The 'Pods' target has transitive dependencies that include static binaries: (

/private/var/folders/82/760vjvcs0q59xh4sd7r0l_l80000gn/T/CocoaPods/Lint/Pods/OpenSSL/lib/libcrypto.a and
/private/var/folders/82/760vjvcs0q59xh4sd7r0l_l80000gn/T/CocoaPods/Lint/Pods/OpenSSL/lib/libssl.a

)) during validation.

There's more discussion at: https://github.com/CocoaPods/CocoaPods/issues/2926 https://github.com/CocoaPods/CocoaPods/issues/3194 https://github.com/CocoaPods/CocoaPods/issues/3267

cjcaufield avatar Mar 14 '16 22:03 cjcaufield

Any progress yet? Why can't OpenSSL just be converted to a dynamic library...

geraldeersteling avatar May 25 '16 12:05 geraldeersteling

@cjcaufield @gerald-coddut Have you ever tried import OpenSSL as a target dependency before the framework?

eg.

target 'SomeTarget' do
    pod 'OpenSSL'
    pod 'FrameworkRequiresOpenSSL'
end

BB9z avatar Sep 06 '16 01:09 BB9z

@BB9z Nope haven't tried it (or maybe I unconsciously did try it), but what difference will (should) it make? The reason it fails and gives the error is because of the fact the pod generates a static library however. Not because other pods in my workspace depend on OpenSSL.

geraldeersteling avatar Sep 12 '16 07:09 geraldeersteling

Same issue here. any progress or solution yet?

appsforall avatar Nov 25 '16 19:11 appsforall

@appsforall

I ended up compiling my own openSSL.framework as Cocoapods was just unable to provide it for me.

geraldeersteling avatar Nov 28 '16 08:11 geraldeersteling

@appsforall How did you do it? . I need to use this pod in our own pod

sunnymopada avatar Jul 04 '17 14:07 sunnymopada

@geraldeersteling how can I do similar to you?

sunnymopada avatar Jul 20 '17 13:07 sunnymopada

@SanyasiraoM if I recall correctly I just compiled the openSSL.framework an added it to my project as an embedded framework...so without Cocoapods

geraldeersteling avatar Jul 20 '17 13:07 geraldeersteling

@geraldeersteling Thanks for reply,

Can you point me to some reference, how to do that? I'm new bee in iOS

sunnymopada avatar Jul 20 '17 13:07 sunnymopada

Look here, I made the framework with the shell script provided there. afterwards just add it as an embedded framework.

geraldeersteling avatar Jul 20 '17 14:07 geraldeersteling

@geraldeersteling Thank you!

I'm also using the same. My use case is to generate pkcs12 file. So I followed https://stackoverflow.com/questions/26883342/ios-how-to-create-pkcs12-p12-keystore-from-private-key-and-x509certificate-in/41856095#41856095

I'm able to use it in a project directly.

I created pod using http://guides.cocoapods.org/making/using-pod-lib-create.html Now how to include openssl in a pod? How can I do below steps?

Add $(YOUR_PATH)/OpenSSL-for-iPhone/include to header search paths
Add $(YOUR_PATH)/OpenSSL-for-iPhone/lib to library search paths
Add libcrypto.a and libssl.a to linked frameworks and libraries
Add the following headers to the bridging header:
Project-Bridging-Header.h:

#import <openssl/err.h>
#import <openssl/pem.h>
#import <openssl/pkcs12.h>
#import <openssl/x509.h>

sunnymopada avatar Jul 20 '17 14:07 sunnymopada

@geraldeersteling any references to include it as a embedded framework?

sunnymopada avatar Jul 20 '17 15:07 sunnymopada

I'm not sure what you mean; the issue was creating an openSSL.framework right? That can be done if you use the scripts in the link I provided earlier. Embedding it in your project is as simple as going to your xcodeproj and add it under Linked Frameworks and Libraries i.e.:

screen shot 2017-07-21 at 08 46 18

geraldeersteling avatar Jul 21 '17 06:07 geraldeersteling