question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build app using cordova-plugin-firebaseex 14.2.1-cli with Xcode 14 and Cordova CLI

See original GitHub issue

Bug report

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.

To reproduce:

  • git clone https://github.com/dpa99c/cordova-plugin-firebasex-test
  • npm install
  • cordova platform add android
  • cordova platform add ios
  • cordova build ios --device --debug

Expected output is a successful build. Actual error output is (NOTE this isn’t the full output just the errors):

~/othersrc/cordova-plugin-firebasex-test/platforms/ios/FirebaseTest.xcodeproj: error: Signing for "FirebaseTest" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'FirebaseTest' from project 'FirebaseTest')
~/othersrc/cordova-plugin-firebasex-test/platforms/ios/Pods/Pods.xcodeproj: error: Signing for "gRPC-C++-gRPCCertificates-Cpp" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
~/othersrc/cordova-plugin-firebasex-test/platforms/ios/Pods/Pods.xcodeproj: error: Signing for "GoogleSignIn-GoogleSignIn" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'GoogleSignIn-GoogleSignIn' from project 'Pods')
~/othersrc/cordova-plugin-firebasex-test/platforms/ios/Pods/Pods.xcodeproj: error: Signing for "FirebaseInAppMessaging-InAppMessagingDisplayResources" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'FirebaseInAppMessaging-InAppMessagingDisplayResources' from project 'Pods')
** ARCHIVE FAILED **
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

We’re in the process of upgrading a Cordova-based app to use the latest plugins, lastest XCode, etc. When I update the project to use cordova-plugin-firebaseex 14.2.1-cli, the iOS build is failing.

I’ve been able to reproduce the issue with the dpa99c/cordova-plugin-firebasex-test repo. See steps above.

Our app fails to build with a similar message to the dpa99c/cordova-plugin-firebasex-test:

~/src/MYAPP/platforms/ios/Pods/Pods.xcodeproj: error: Signing for "GoogleSignIn-GoogleSignIn" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'GoogleSignIn-GoogleSignIn' from project 'Pods')

Expected behavior:

iOS build completes without errors

Steps to reproduce:

Build steps for our app are similar to the reproduction steps specified above with the test repo.

Screenshots

Environment information

  • Cordova CLI version
    • 11.0.0
  • Cordova platform version
  android 11.0.0
  ios 6.2.0
Available platforms:
  browser ^6.0.0
  electron ^3.0.0
  osx ^6.0.0
  • Plugins & versions installed in project (including this plugin)
cordova-android-play-services-gradle-release 4.0.0 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 3.0.1 "cordova-android-support-gradle-release"
cordova-custom-config 5.1.1 "cordova-custom-config"
cordova-plugin-android-tv 1.0.0 "AndroidTVPlugin"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-app-version 0.1.14 "AppVersion"
cordova-plugin-battery-status 2.0.3 "Battery"
cordova-plugin-calendar 5.1.6 "Calendar"
cordova-plugin-camera 6.0.0 "Camera"
cordova-plugin-certificates 0.6.4 "Certificate Plugin"
cordova-plugin-device 2.1.0 "Device"
cordova-plugin-email-composer 0.10.1 "EmailComposer"
cordova-plugin-file-transfer 2.0.0-dev "File Transfer"
cordova-plugin-file 7.0.0 "File"
cordova-plugin-firebasex 14.2.1-cli "Google Firebase Plugin"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-network-information 3.0.0 "Network Information"
cordova-plugin-tts 0.2.3 "TTS"
cordova-plugin-whitelist 1.3.5 "Whitelist"
cordova-plugin-wkwebview-file-xhr 3.1.0 "Cordova WKWebView File XHR Plugin"
  • Dev machine OS and version, e.g.
Macbook Pro 2021 M1
ProductName:	macOS
ProductVersion:	12.6
BuildVersion:	21G115

Runtime issue N/A

Android build issue: N/A

iOS build issue:

  • Node JS version
    • v16.15.0
  • XCode version
    • 14.0 (14A309)

Related code:

insert any relevant code here such as plugin API calls / input parameters

Console output

console output

// Paste any relevant JS/native console output here



Other information:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:27 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
jkorrekcommented, Sep 29, 2022

I was able to workaround this issue with a combination of a cordova hook & pods post_install script.

It seems like XCode 14 changed the default of CODE_SIGNING_ALLOWED option from NO to YES. A pods post_install script can be used as a workaround, to set it to NO. (More infos: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1201464693)

We can add the required post_install script with a cordova hook (similiar to the approach described here: https://github.com/dpa99c/cordova-plugin-firebasex/issues/735#issuecomment-1180019463).

My final configuration / fix looks like this:

Add a hook to the ios platform inside config.xml:

<hook src="hooks/firebaseDeploymentTargetFix.js" type="after_prepare" />

The hook itself looks like this:

#!/usr/bin/env node

// Workaround for https://github.com/dpa99c/cordova-plugin-firebasex/issues/766
// set CODE_SIGNING_ALLOWED to NO to avoid signing errors during CI Builds

const fs = require("fs");
const path = require("path");
const execa = require("execa");

module.exports = (context) => {
  const platformPath = path.resolve(context.opts.projectRoot, "platforms/ios");
  const podfilePath = path.resolve(platformPath, "Podfile");

  if (!fs.existsSync(podfilePath)) {
    console.log(`'${podfilePath}' does not exist. Firebase deployment fix skipped.`);
    return;
  }

  let podfileContent = fs.readFileSync(podfilePath, "utf-8");
  if (podfileContent.indexOf("post_install") == -1) {
    podfileContent += `

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
      target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
      end
    end
  end
end

`;

    fs.writeFileSync(podfilePath, podfileContent, "utf-8");

    return execa("pod", ["install", "--verbose"], {
      cwd: platformPath,
    });
  }
};

There is probably a more sensible way to fix the problem. In the meantime, this might help some of you to get your builds going again 😃

0reactions
QuentinFarizoncommented, Nov 29, 2022

Ok, indeed cordova-plugin-add-swift-support is not needed since cordova-iod 6.2.0 (thanks @dpa99c for pointing that out). By updating plugins that overwrote Podfile for Swit support, it’s now preparing/building OK (at least concerning Swift support)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Command Failing while trying… | Apple Developer Forums
I am trying to add a plugin for IOS platform for my cordova project. The IOS platform and the plugin is added using...
Read more >
iOS Platform Guide - Apache Cordova
This guide shows how to set up your SDK development environment to deploy Cordova apps for iOS devices such as iPhone and iPad,...
Read more >
Getting error when building iOS platform with cordova-cli
Open the xcode project that it failed to build (the exact build number and directory will be in the output. Open the xcode...
Read more >
cordova-plugin-firebasex - npm
If building your project in Xcode, you need to open YourProject.xcworkspace (not YourProject.xcodeproj ) so both your Cordova app project ...
Read more >
Build iOS 14 apps, new docs and CLI commands - Ionic
New iOS build option. This new build stack uses Cordova CLI v10 (supporting cordova-android 9 and cordova-ios 6.1) and Xcode 12 to build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found