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 linking libxlsxwriter and BoringSSL-GRPC (Xcode 12.5) #10772

Closed
1 task done
ulmentflam opened this issue Jul 9, 2021 · 4 comments
Closed
1 task done

Comments

@ulmentflam
Copy link

Report

What did you do?

Run pod install
Run Xcode Build
See Buildtime failure:

In file included from /Users/.../LibXlsxWriterSwiftSample/Pods/libxlsxwriter/third_party/md5/md5.h:42:
/Users/.../LibXlsxWriterSwiftSample/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.

What did you expect to happen?

The pod dependencies should have built correctly and linked /Pods/libxlsxwriter/third_party/md5/md5.c to the header /Pods/libxlsxwriter/third_party/md5/md5.h.

What happened instead?

The pods didn't build correctly and linked /Pods/libxlsxwriter/third_party/md5/md5.ct to the BoringSSL-GRPC header Pods/BoringSSL-GRPC/src/include/openssl/md5.h: instead of the header included in the libxlsxwriter project.

CocoaPods Environment

Stack

   CocoaPods : 1.10.1
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
    RubyGems : 3.0.3
        Host : macOS 11.4 (20F71)
       Xcode :  ()
         Git : git version 2.23.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : 52inc - git - https://github.com/52inc/52inc-Spec.git @ 5b1e2c9e8da7904c6ecb56fc64843b0a046ba82f

               52inc-Spec - git - git@github.com:52inc/52inc-Spec.git @ 2849bcb8a099ce18b08c821b2fd6514c4dac5fd4

               Specs - git - git@github.com:CocoaPods/Specs.git @ 568b39834e81aa7bbede17766f07dcd32e7bb52a

               trunk - CDN - https://cdn.cocoapods.org/
               twilio - git - https://github.com/twilio/cocoapod-specs @ 9bf659ed7246ba34625b81754031fbd5ac20fe68

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

claide-plugins         : 0.9.2
cocoapods-deintegrate  : 1.0.4
cocoapods-dependencies : 1.0.0.beta.1
cocoapods-plugins      : 1.0.0
cocoapods-search       : 1.0.0
cocoapods-stats        : 1.1.0
cocoapods-trunk        : 1.4.1
cocoapods-try          : 1.1.0
cocoapods_debug        : 0.1.0

Podfile

# 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

I also built this in 1-10-stable

Project that demonstrates the issue

I have forked the sample project for libxlsxwriter and added BoringSSL-GRPC into the Podfile.
https://github.com/ulmentflam/LibXlsxWriterSwiftSample

I have also created an issue on the libxlsxwriter application jmcnamara/libxlsxwriter#342

@paulb777
Copy link
Member

paulb777 commented Jul 9, 2021

Some context about this issue from https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseFirestore.podspec#L54 which accesses headers via preserve_paths to workaround Xcode's sloppy header map functionality:

  # Internal headers that aren't necessarily globally unique. Most C++ internal
  # headers should be here to avoid polluting the global header map with
  # unprefixed filenames.
  #
  # These filenames won't be available in Xcode's "quick open" but the types
  # inside these files will be available.

@ulmentflam
Copy link
Author

I was able to fix this issue in the libxlsxwriter library using a similar work around that the Firebase iOS SDK used.

@graphicstone
Copy link

graphicstone commented Sep 15, 2023

Hi @ulmentflam @paulb777 , I am also facing the same error of 'openssl_grpc/base.h' file not found. The complete errro is

Lexical or Preprocessor Issue (Xcode): 'openssl/base.h' file not found /Users/graphicstone/StudioProjects/toad_cash_mobile/ios/Pods/BoringSSL-GRPC/src/include/openssl/aes.h:51:9

Can you please help me with a fix here, I am stuck with this error for the past 2 days and I have tried all of the solutions that are provided on Stackoverflow and other platforms. I have tried clearing the Pods, Podfile.lock Pod cache clean and everything but none is working for me.

I am providing my Podfile below for further reference:

# Uncomment this line to define a global platform for your project
platform :ios, '14.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!
  # see...
  # https://github.com/juliansteenbakker/mobile_scanner/issues/335#issuecomment-1308829103
  # https://issuetracker.google.com/issues/254418199#comment48
  pod 'MLKitVision', :podspec => 'MLKitVision.podspec.json'
  pod 'MLKitCommon', :podspec => 'MLKitCommon.podspec.json'
  pod 'BoringSSL-GRPC'
  pod 'gRPC-Core'
  pod 'Web3Auth'

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

I have a flutter project and I am not very fluent in iOS development so there might be something in the Podfile that I am missing, any help would mean a lot, thanks.

@samyakb-work
Copy link

I was able to fix this issue in the libxlsxwriter library using a similar work around that the Firebase iOS SDK used.

@ulmentflam, could you please elaborate how you were able to fix it?

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

No branches or pull requests

4 participants