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

CocoaPods issue with Firebase and BoringSSL-GRPC (Xcode 12.5) #342

Closed
ulmentflam opened this issue Jul 9, 2021 · 16 comments
Closed

CocoaPods issue with Firebase and BoringSSL-GRPC (Xcode 12.5) #342

ulmentflam opened this issue Jul 9, 2021 · 16 comments
Assignees
Labels

Comments

@ulmentflam
Copy link
Contributor

ulmentflam commented Jul 9, 2021

When building in Xcode 12 and installing the library through CocoaPods I get the error 'openssl_grpc/base.h' file not found. It appears that the libxlsxwriter tries to use the BoringSSL-GRPC md5.h file when both pods are installed. At first I thought it was related to this issue in the CocoaPods repo and issue #337. However, when I ran pod update and pod install from the 1-10-stable branch, the issue persisted. The issue is not present in older versions of the Firebase SDK or when using older versions of BoringSSL-GRPC.
My thought is that there is still a problem with the header files being symlinked to the wrong place, but the previously mentioned solutions should have fixed that issue.

The logs say:
image

In file included from /Users/.../Pods/libxlsxwriter/third_party/md5/md5.c:42:
/Users/.../Pods/BoringSSL-GRPC/src/include/openssl/md5.h:60:10: fatal error: 'openssl_grpc/base.h' file not found
#include <openssl_grpc/base.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.

So libxlsxwriter is attempting to use the "md5.h" file from BoringSSL-GRPC and not the "md5.h" file included in the libxlsxwriter project. This leads me to believe that the headers are still not being linked correctly by CocoPods. Any help on fixing this issue or a better methodology for installing both of these frameworks would be greatly appreciated.

@jmcnamara
Copy link
Owner

Could you create a small project that demonstrates this issue. Maybe based on https://github.com/FrankenApps/LibXlsxWriterSwiftSample

Also, is it possible to re-arrange the order of pod usage/compilation so that libxlsxwriter is included before BoringSSL.

Adding @FrankenApps in case he has any suggestions.

@jmcnamara jmcnamara self-assigned this Jul 9, 2021
@jmcnamara jmcnamara added the bug label Jul 9, 2021
@ulmentflam
Copy link
Contributor Author

@jmcnamara I replicated the issue here https://github.com/ulmentflam/LibXlsxWriterSwiftSample just adding 'BoringSSL-GRPC' to the pod file causes the issue. I didn't have to include all the Firebase dependencies.

@jmcnamara
Copy link
Owner

Does the order of inclusion have any effect, i.e., if you put libxlsxwriter before borings or vice-versa?

@ulmentflam
Copy link
Contributor Author

Unfortunately not, it seems to always build last for some reason.

@ulmentflam
Copy link
Contributor Author

I even moved the order of inclusion in the Podfile.lock and that has no effect on the order that the dependencies are installed.

@jmcnamara
Copy link
Owner

Just to avoid any ambiguity can you add the modified pod file you are using with the LibXlsxWriterSwiftSample repo.

@ulmentflam
Copy link
Contributor Author

Absolutely

# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'

target 'LibXlsxWriterSwiftSample' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for LibXlsxWriterSwiftSample
  pod 'libxlsxwriter', '~> 0.9'
  pod 'Sourceful', '~> 0.2' #Only present for synzax highlighting
  pod 'BoringSSL-GRPC'
end

@ulmentflam
Copy link
Contributor Author

@jmcnamara @FrankenApps I believe I have a fix for this issue in PR #343. The header files link correctly if preserve_paths is included in the podspec and references the 'third_party' header files.

@jmcnamara
Copy link
Owner

jmcnamara commented Jul 9, 2021

@ulmentflam Thanks for the fix. It looks valid.

I was just about to respond to ask if you could change the ordering of the include files within Xcode to see if that would resolve the issue. Could you try that as well to see if works (for the sake of completeness). Change the order in "Framework search paths" and "Header search paths" in Build Settings:

Screenshot 2021-07-09 at 19 36 34

@ulmentflam
Copy link
Contributor Author

@jmcnamara I updated the order in "Framework Search Paths" and "Header Search Paths" and it resulted in the same build error.

@ulmentflam
Copy link
Contributor Author

image

@jmcnamara
Copy link
Owner

Cool. Thanks for checking.

I'll merge in your fix. It needs to be squashed since there are some WIP commits in the PR. I'll see if Github can do that cleanly. If not I'll get you to rebase it and resubmit.

@ulmentflam
Copy link
Contributor Author

Not a problem!

@jmcnamara
Copy link
Owner

Thanks for the debugging and fix. I've pushed a new release (1.1.0) and new Cocoapod with the fix.

@ulmentflam
Copy link
Contributor Author

You are very welcome! Thanks for your help and getting a release out so quickly!

@adesun2k
Copy link

Please any solution yet? Still can't find a way around for XCode/Swift5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants