firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

FirebaseInAppMessaging code sign error on Xcode 14

Open minlite opened this issue 2 years ago • 16 comments

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 14.0 Beta (14A5228q)
  • Firebase SDK version: 9.1.0
  • Installation method: Cocoapods
  • Firebase Component: InAppMessaging
  • Target platform(s): iOS

[REQUIRED] Step 2: Describe the problem

When using Xcode 14 to build an iOS project containing the InAppMessaging component, the build fails with a code signing issue:

Signing for "FirebaseInAppMessaging-InAppMessagingDisplayResources" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'FirebaseInAppMessaging-InAppMessagingDisplayResources' from project 'Pods'

Steps to reproduce:

  1. Add FIrebaseInAppMessaging pod to Podfile
  2. Run pod install
  3. Build iOS project in Xcode 14.
  4. Error is shown:

Signing for "FirebaseInAppMessaging-InAppMessagingDisplayResources" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'FirebaseInAppMessaging-InAppMessagingDisplayResources' from project 'Pods'

Quick fix

Selecting the team in the Signing & Capabilities tab of the FirebaseInAppMessaging-InAppMessagingDisplayResources project fixes the build.

minlite avatar Jun 07 '22 19:06 minlite

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Jun 07 '22 19:06 google-oss-bot

This is not Firebase related bug - happens with other pods too. Workaround: https://github.com/CocoaPods/CocoaPods/issues/8891

sarsonj avatar Jun 08 '22 17:06 sarsonj

Thanks for the discussion so far. Is there something different between Xcode 13 and Xcode 14?

paulb777 avatar Jun 08 '22 17:06 paulb777

@sarsonj I just checked again and it does seem this is a regression with Xcode 14 (even though the root cause might be the issue you mentioned).

Xcode 13.4.1

  1. Cloned project on our CI machine with Xcode 13.4.1 (13F100)
  2. pod install
  3. Build
  4. Build is fine

Xcode 14.0

  1. Cloned project on a development machine with Xcode 14.0 Beta (14A5228q)
  2. pod install
  3. Build
  4. Build fails with the error: error build: Signing for "FirebaseInAppMessaging-InAppMessagingDisplayResources" requires a development team. Select a development team in the Signing & Capabilities editor.

@paulb777 Not sure what has changed in Xcode 14 that causes it to suddenly complain about this.

minlite avatar Jun 08 '22 18:06 minlite

@minlite Facing the same issue here

SaloniSS avatar Jun 11 '22 02:06 SaloniSS

facing same issue

ashutosh-akss avatar Jun 21 '22 16:06 ashutosh-akss

facing same issue

xiaogehenjimo avatar Jun 22 '22 05:06 xiaogehenjimo

This is a CocoaPods/Xcode issue. See https://github.com/CocoaPods/CocoaPods/issues/11402. Please add a reaction instead of another comment, unless you have something to add about the workaround(s) or resolution.

paulb777 avatar Jun 23 '22 03:06 paulb777

The Xcode14.0Beta2 fixed the problem.

cdoky avatar Jun 23 '22 06:06 cdoky

The Xcode14.0Beta2 fixed the problem.

I am on beta 2 and I still see these error

nicolas6422 avatar Jul 12 '22 23:07 nicolas6422

This post_install script in podfile fixed it. As it seems setting the own developer team is necessary. Replace Your Team ID with the TeamID of your project.

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
         end
    end
  end
end

yuanxun2007 avatar Jul 14 '22 06:07 yuanxun2007

This post_install script in podfile fixed it. As it seems setting the own developer team is necessary. Replace Your Team ID with the TeamID of your project.

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
         end
    end
  end
end

Thanks @yuanxun2007, works for me.

Tale-Dev avatar Jul 26 '22 11:07 Tale-Dev

It works to me:

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

Reference: https://github.com/CocoaPods/CocoaPods/issues/8891

paulocoutinhox avatar Sep 20 '22 15:09 paulocoutinhox

I have tried this script, it works fine on my local machine but it does not work on codemagic CI/CD

This post_install script in podfile fixed it. As it seems setting the own developer team is necessary. Replace Your Team ID with the TeamID of your project.

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
         end
    end
  end
end

wattanakorn495 avatar Sep 30 '22 03:09 wattanakorn495

I have tried this script, it works fine on my local machine but it does not work on codemagic CI/CD

This post_install script in podfile fixed it. As it seems setting the own developer team is necessary. Replace Your Team ID with the TeamID of your project.

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
         end
    end
  end
end

please try bellow target.build_configurations.each do |config| config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' end

yuanxun2007 avatar Sep 30 '22 10:09 yuanxun2007

It Keeps failing on CI

config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
or 
config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"

Both not working

Any further help on this?

mrazam110 avatar Dec 15 '22 11:12 mrazam110

Should be fixed with CocoaPods 1.12.0. See https://github.com/CocoaPods/CocoaPods/issues/11402

paulb777 avatar Apr 18 '23 22:04 paulb777