13

I'm updating my iOS app to also work on Mac. After selecting the Mac checkbox, I am getting the error in the screenshot below when trying to build for Mac. It's telling me I need to select a development team for this Cocoapod framework. However, I can build to an iPhone or iPad without selecting a development team.

I tried selecting a development team which made the error go away but when I uploaded the app binary to Apple, it was rejected with the error: ITMS-90284: Invalid Code Signing - The executable 'Timestamp.app/Contents/Frameworks/BSImagePicker.framework/Versions/A/Resources/BSImagePicker.bundle' must be signed with the certificate that is contained in the provisioning profile.

I am thinking I'm getting this error from Apple because I selected a development team for this Cocoapod framework.

Any suggestion on how to handle this error for a Catalyst app?

Mac Build Error

DrMickeyLauer
  • 4,455
  • 3
  • 31
  • 67
chickenparm
  • 1,570
  • 1
  • 16
  • 36

4 Answers4

6

I solved this issue setting the development team to each pod during pod install like this issue from CocoaPods repo describes: https://github.com/CocoaPods/CocoaPods/issues/8891#issuecomment-546636698

You need to add the following at the end of your Podfile:

def fix_config(config)
  if config.build_settings['DEVELOPMENT_TEAM'].nil?
    config.build_settings['DEVELOPMENT_TEAM'] = '<YOUR TEAM ID HERE>'
  end
end

post_install do |installer|
  installer.generated_projects.each do |project|
    project.build_configurations.each do |config|
        fix_config(config)
    end
    project.targets.each do |target|
      target.build_configurations.each do |config|
        fix_config(config)
      end
    end
  end
end

Then you need to do a pod install in order for it to work.

You can find your team id here: https://developer.apple.com/account/#!/membership

2022 fall Apple Developer site

enter image description here

old Apple Developer site

enter image description here

pableiros
  • 14,932
  • 12
  • 99
  • 105
3

I have this issue with MessageKitAssets, this works for me:

Select MessageKitAssets from pods targets,

Select a team manually, and set signing certificate 'sign to run locally' (for platform macOS) Use iOS bundle id, provision profile not required.

Sam Xu
  • 252
  • 3
  • 5
  • 2
    Still an issue as of January 2021; selecting my own "team" and "sign to Run Locally" also was the missing piece for me. After doing this I was able to upload my Mac Catalyst binary and it was processed without issue. – lukemmtt Jan 03 '21 at 02:54
  • @lukemmtt did you find a solution? – Vlad Khambir Jan 12 '21 at 19:50
  • @VladKhambir No, nothing more than the workaround presented here by Sam Xu. The workaround is tedious because it needs to be performed on 5 different frameworks every time I build for Mac Catalyst, but it gets the job done and my app passed the App Store review with this method. – lukemmtt Jan 13 '21 at 21:37
1
post_install do |installer|

1. Add the below code at the end of POD file.
2. Install the pod again
3. Run the app

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
-5

Add this to the top of your podfile:

source 'https://github.com/CocoaPods/Specs.git'

RawMean
  • 8,374
  • 6
  • 55
  • 82