Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error framework not found openssl after update to GRPC 1.15.1 & BoringSSL 0.0.2 #16821

Closed
sibinlu opened this issue Oct 10, 2018 · 12 comments
Closed

Comments

@sibinlu
Copy link

sibinlu commented Oct 10, 2018

What version of gRPC and what language are you using?

Objective-C Swift3
GRPC 1.15.1
BoringSSL 0.0.2

What operating system (Linux, Windows, …) and version?

Xcode 10.0

What did you do?

I use cocoapod to install a sdk (TokenSdk) which depends on GRPC. everything is all right before 1.15.1 release. After GRPC update to 1.15.1, an error
ld: framework not found openssl
will be throw when I want to archive my project.

Currently I add pod 'BoringSSL-GRPC', '0.0.1' to avoid the pod update.

Podfile:

project 'Token', 'BetaDebug' => :debug, 'BetaAdhoc' => :release

def common_pods
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/tokenio/token-cocoa-pods.git'
pod 'CocoaLumberjack/Swift'
pod 'AFNetworking''
pod 'Fabric'
pod 'TokenSdk'
pod 'Crashlytics'
pod 'RealmSwift', '3.1.0'
pod 'Localize-Swift'
#pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :submodules => true
#pod 'Realm', :git => 'https://github.com/realm/realm-cocoa.git', :submodules => true
pod 'Bolts-Swift'
pod 'Alamofire'
pod 'CountryPicker'
pod 'BugfenderSDK/ObjC'
pod 'Firebase/Messaging'
pod 'Firebase/Core'
pod 'BoringSSL-GRPC', '0.0.1'
end

What did you expect to see?

Archive successfully

What did you see instead?

ld: framework not found openssl

Any idea why this happens?

@petard
Copy link

petard commented Oct 10, 2018

I have the same issue

@muxi
Copy link
Member

muxi commented Oct 10, 2018

@sibinlu @petard - what are the names of the pods that you are using? The reason was likely those pods you used were using BoringSSL that gRPC depended on, but they did not explicitly specify the dependency in their podspec. We recently renamed the BoringSSL lib to avoid conflict with other openssl libraries, which can cause issue in this case.

@petard
Copy link

petard commented Oct 10, 2018

From my pod file:

pod 'googleapis', :path => '.'

and the googleapis is defined in this podspec for GCP

Locking the pod to pod 'BoringSSL-GRPC', '0.0.1' works for me too.

@muxi
Copy link
Member

muxi commented Oct 10, 2018

@petard - thanks. And can you tell us which line did you fail on? I tried building googleapis; it seems building ok on my side.

@sibinlu
Copy link
Author

sibinlu commented Oct 10, 2018

@muxi Im using this sdk. https://github.com/tokenio/sdk-objc
I tried to add ss.dependency "BoringSSL-GRPC" explicitly in sdk's Podspec but it don't work.
Building will not throw the error. Only archiving with xcode will have this issue.

@muxi
Copy link
Member

muxi commented Oct 10, 2018

@sibinlu - Sorry I actually meant archiving was ok on my side. Let me try your sdk.

@muxi
Copy link
Member

muxi commented Oct 10, 2018

@sibinlu - I also passed archiving tokensdk. I wonder if you have any #include <openssl/...> header in your project?

@sibinlu
Copy link
Author

sibinlu commented Oct 11, 2018

Hey @muxi , we don't have any #include <openssl/...> header in my project.

The good news is that you remind me to check the xcode project file and I find that there is a setting -framework openssl in Other Linker Flag. After I update them to openssl_grpc, the archiving works.

My theory is that if you have worked with earlier version boringSSL, your project will explicitly have the openssl framework setting. Even after you update to the new version, for some reason the flag hasn't been changed. That explain why muxi don't have that issue on a new project.

If you have linked an earlier version BoringSSL (in my case that's TokenSdk 1.0.99) then switch to the newest version , you will suffer that problem. @petard Hope this works for you too.

@muxi
Copy link
Member

muxi commented Oct 11, 2018

That makes sense. Thanks for the idea @sibinlu. By update them to openssl_grpc, did you do it manually in Xcode or did you regenerate using Cocoapods?

@sibinlu
Copy link
Author

sibinlu commented Oct 11, 2018

I did it manually.

@petard
Copy link

petard commented Oct 11, 2018

@sibinlu Awesome, changing the framework name to openssl_grpc in the linker flags fixed it for me too. Great find!

@srini100
Copy link
Contributor

@muxi, it will be good to add a note about this in the README file.

muxi added a commit that referenced this issue Dec 13, 2018
muxi added a commit that referenced this issue Dec 20, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Mar 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants