Firestore build error in abseil with Swift and Cocoapods

1.2k Views Asked by At

I have a swift project that is using Firestore. There is a build issue when compiling the abseil pod that is included by Firestore. When I attempt to build the project, I intermittently get this error: absl/base/internal/inline_variable.h file not found.

I am using Xcode 11.4, Cocoapods 1.9.1, and Swift 5.

I have tried clearing derived data, updating pods, and deintegrating pods. The one workaround that seems to work is the following, but when I switch devices for a build, the error occurs again. 1. Comment out Firestore in the Podfile. 2. Run bundle exec pod install 3. Open Xcode and build. 4. Uncomment Firestore in the Podfile. 5. Run bundle exec pod install 6. Open Xcode and build.

These steps will work temporarily. Does anyone know of a way to get past this issue?

Here is the Podfile that I am using:

source '[email protected]:MyCompany/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '11.0'

target 'MyApp' do
  use_frameworks!

  pod 'RNCryptor'
  pod 'KeychainSwift'
  pod 'Sentry', git: 'https://github.com/getsentry/sentry-cocoa.git', tag: '3.11.0'
  pod 'Fabric'
  pod 'Crashlytics'
  pod 'UICircularProgressRing', '~>4.1.0'
  pod 'IHKeyboardAvoiding', git: '[email protected]:MyCompany/IHKeyboardAvoiding.git', branch: 'master'
  pod 'GTProgressBar'
  pod 'AWSSNS'
  pod 'AWSCognito'
  pod 'AWSS3'
  pod 'Validator', git: 'https://github.com/jlowe234/validator'
  pod 'SwiftyOnboard', git: '[email protected]:MyCompany/SwiftyOnboard.git', branch: 'master'

  pod 'Firebase/Auth'
  pod 'Firebase/Firestore'
  pod 'Firebase/Storage'

  target 'MyAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'MyAppUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end
2

There are 2 best solutions below

1
On

After spending hours searching and trying to solve this issue, the only solution was to add a pre-compiled Firestore SDK.

add this line to the PodFile

pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '7.3.0'

refer to firestore-ios-sdk-frameworks for more info

0
On

I solved this problem by updating to the latest version of Sentry. Apparently there is a build conflict between Firestore and version 3.11.0 of Sentry. The fix is to change the Podfile entry for Sentry to the following:

pod 'Sentry'