FredericJacobs / OpenSSL-Pod

Unmaintained - please fork. Email me to take over the CocoaPod
74 stars 112 forks source link

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

Open cjcaufield opened 8 years ago

cjcaufield commented 8 years ago

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 commented 8 years ago

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

geraldeersteling commented 8 years ago

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

BB9z commented 8 years ago

@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
geraldeersteling commented 8 years ago

@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.

appsforall commented 8 years ago

Same issue here. any progress or solution yet?

geraldeersteling commented 7 years ago

@appsforall

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

sunnymopada commented 7 years ago

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

sunnymopada commented 7 years ago

@geraldeersteling how can I do similar to you?

geraldeersteling commented 7 years ago

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

sunnymopada commented 7 years ago

@geraldeersteling Thanks for reply,

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

geraldeersteling commented 7 years ago

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

sunnymopada commented 7 years ago

@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 commented 7 years ago

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

geraldeersteling commented 7 years ago

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