cordova-plugin-firebasex: Xcode 16 & iOS 18 Build Crash

Bug report

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

When attempting to build a project using this plugin with Xcode 16 beta, the build will crash with the following error:

/path/to/project/platforms/ios/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc unsupported option ‘-G’ for target ‘arm64-apple-ios13.0-simulator’

This is a known issue which comes from a dependency that Firebase uses. This issue had been reported and fixed.

Firebase was also aware of the issue and updated their library which should have resolved this issue.

Below are the following tickets surrounding the issue.

Expected behavior:

Build should be successful.

Steps to reproduce:

Add current plugin to any project and try to build with Xcode 16 beta

Screenshots

Environment information

  • Cordova CLI version
    • 12.0.0
  • Cordova platform version
    • cordova-ios@7.1.0
  • Plugins & versions installed in project (including this plugin)
    • cordova-plugin-firebasex@16.5.0
  • Dev machine OS and version, e.g.
    • OSX
      • macOS 14.6.1 (23G93)

Runtime issue

  • Device details
    • iPhone 15 Pro Max Simulator
  • OS details
    • iOS 18.0 (22A5346a)

iOS build issue:

  • Node JS version
    • v22.6.0
  • XCode version
    • Xcode 16.0 - Build version 16A5230g

Other information:

There is a SO post that talked about the issue and included a workaround solution when there was no fix:

But looking at the Firebase library spec, I beleive the issue has been resolved in version 11.0.0. (Current version is 11.1.0)

The above linked issue tickets says:

Fixed in 1.65.2 and 1.66.0-pre1 release

Looking at the podspec of FirebaseFirestoreInternal@11.1.0 it says gRPC-Core version is ~> 1.65.0. I believe this will pull in the fixed version.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23 (5 by maintainers)

Most upvoted comments

Dears,

What I did is add the workaround on https://stackoverflow.com/a/78633109 into scripts/ios/helper.js into the applyPodsPostInstall function.

The new code added:

if target.name == 'BoringSSL-GRPC'
         target.source_build_phase.files.each do |file|
             if file.settings && file.settings['COMPILER_FLAGS']
                 flags = file.settings['COMPILER_FLAGS'].split
                 flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
                 file.settings['COMPILER_FLAGS'] = flags.join(' ')
             end
         end
     end

The resulting function:

    applyPodsPostInstall: function(pluginVariables, iosPlatform){
        var podFileModified = false,
            podFilePath = iosPlatform.podFile,
            podFile = fs.readFileSync(path.resolve(podFilePath)).toString(),
            DEBUG_INFORMATION_FORMAT = pluginVariables['IOS_STRIP_DEBUG'] && pluginVariables['IOS_STRIP_DEBUG'] === 'true' ? 'dwarf' : 'dwarf-with-dsym',
            IPHONEOS_DEPLOYMENT_TARGET = podFile.match(iosDeploymentTargetPodRegEx)[1];

        if(!podFile.match('post_install')){
            podFile += `
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['DEBUG_INFORMATION_FORMAT'] = '${DEBUG_INFORMATION_FORMAT}'
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '${IPHONEOS_DEPLOYMENT_TARGET}'
            if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
                config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
            end
        end
        if target.name == 'BoringSSL-GRPC'
            target.source_build_phase.files.each do |file|
                if file.settings && file.settings['COMPILER_FLAGS']
                    flags = file.settings['COMPILER_FLAGS'].split
                    flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
                    file.settings['COMPILER_FLAGS'] = flags.join(' ')
                end
            end
        end
    end
end
                `;
            fs.writeFileSync(path.resolve(podFilePath), podFile);
            utilities.log('cordova-plugin-firebasex: Applied post install block to Podfile');
            podFileModified = true;
        }
        return podFileModified;
    },

Hope it helps.

This should now be fixed in v17.0.0 of the plugin which I’ve just released: it pins v11.2.0 of the Firebase iOS SDK, as well as GoogleSignIn v7.0.0 (plugin code has been updated for breaking API changes in this) and GoogleTagManager v8.0.0 Also added IOS_FIREBASE_IN_APP_MESSAGING_VERSION to enable setting that to a different version (i.e. -beta) than other iOS SDK component versions. It’s a new major plugin version as Firebase iOS SDK v11 drops support for iOS 12 which is a breaking change.

I’ve regression tested it using the example project with XCode v16 / iOS v18 / macOS v15 Let me know if you still encounter any issues with this.

P.S. If you have pinned component versions in your package.json / plugins/fetch.json, don’t forget to update or remove them.

Check the deployment target in Podfile and Xcode: it needs to be 13.0 or above.

For comparison, here’s the console log from a successful build of the example project using XCode 16, cordova-ios@7, cordova-plugin-firebasex@17.0.0: https://pixeldrain.com/u/twZRspSh

I can confirm this. I made changes in Podfile:

  • Firebase to 11.2.0
  • GoogleSignIn to 7.0.0
  • GoogleTagManager to 8.0.0.
  • iOS deployment target and platform increased

After that there were some changes in code,

  • FirebasePlugin Changed code in accordance with migration guide (See pictures)
  • AppDelegate+FirebasePlugin Added #import "FirebaseAuth-Swift.h"

After that, I was able to build the app, but my app doesn’t use Google SignIn so I couldn’t test that part.

https://developers.google.com/identity/sign-in/ios/quick-migration-guide https://cocoapods.org/pods/GoogleSignIn#changelog AppDelegate+FirebasePlugin Error image

FirebasePlugin Errors image image

FirebasePlugin after fix image image

if target.name == ‘BoringSSL-GRPC’ target.source_build_phase.files.each do |file| if file.settings && file.settings[‘COMPILER_FLAGS’] flags = file.settings[‘COMPILER_FLAGS’].split flags.reject! { |flag| flag == ‘-GCC_WARN_INHIBIT_ALL_WARNINGS’ } file.settings[‘COMPILER_FLAGS’] = flags.join(’ ') end end end

How can we add this? Do we need to make a new version of the firebasex plugin? I tried to add the code directly in the Podfile on XCode but still build failed.