Open chrisballinger opened 5 years ago
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Still not resolved as macOS 10.15 is already released.
Here is a Podfile hack workaround:
def fix_config(config)
# https://github.com/CocoaPods/CocoaPods/issues/8891
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
This workaround might not actually work after all. Although it builds and runs locally after the fix, the binary is not accepted by App Store Connect, and is rejected with code ITMS-90284
"Invalid Code Signing".
ITMS-90284: Invalid Code Signing - The executable 'Example.app/Contents/Resources/ExamplePodBundle.bundle' must be signed with the certificate that is contained in the provisioning profile.
Someone else posted about this issue here: https://stackoverflow.com/questions/58547010/ios-catalyst-cocoapod-framework-error-signing-requires-a-development-team
I submitted a radar FB7425571 because I really don't know how to fix this. It seems that resource bundle targets aren't compatible with Mac Catalyst App Store builds at all. It works just fine when running locally exported via Developer ID.
So far it seems the only workaround is to remove all resource bundle targets, which might be a big issue especially because they are "strongly recommended" in the podspec docs: https://guides.cocoapods.org/syntax/podspec.html#resource_bundles
Another workaround is to create exported archives of the resource bundles and then include that version instead.
@chrisballinger you can try set 'Signing Certificate' to 'Sign to Run Locally'. like this
This is probably a better way to fix it, without specifying the team id.
post_install do |installer|
installer.pods_project.targets.each do |target|
# Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally'
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_SIGN_IDENTITY[sdk=macosx*]'] = '-'
end
end
end
end
Relatedly, adding the option CODE_SIGN_IDENTITY='-'
is a workaround for xcodebuild invocations.
Adding CODE_SIGN_IDENTITY[sdk=macosx*]='-'
would be a relatively straightforward change on the CocoaPods side - if this is the correct way to do it than we can move forward with that
Automatically signing to run locally is the right fix for local development. I'm not sure about deployment.
Won't Xcode re-sign when exporting archives?
Just to confirm settings for deployment through the appstore:
Setting a team manually, and setting signing certificate 'development' results in the archive being signed by XCode and uploading to the store, but being rejected during processing with:
ITMS-90284: Invalid Code Signing - The executable 'Off.app/Contents/Frameworks/Material.framework/Versions/A/Resources/com.cosmicmind.material.fonts.bundle' must be signed with the certificate that is contained in the provisioning profile
Setting a team manually, and setting signing certificate 'sign to run locally' uploads correctly and results in a build that I can select for release in appstore connect.
So it's sounding like the CODE_SIGN_IDENTITY[sdk=macosx*]='-'
works for development but not uploading to the App Store.
This is a bit problematic since we'll now need to pull the development team ID from somewhere. We can add code to infer it from the project but we may need new DSL for specifying it within the target
block in the Podfile
CODE_SIGN_IDENTITY[sdk=macosx*]='-'
works for uploading to the App Store.
It looks like Xcode 13.3 beta now imposes the same requirement on resource bundles even when building for iOS, not Mac Catalyst.
UPD: I tried CODE_SIGN_IDENTITY[sdk=iphone*]='-'
but it didn't help, Xcode is still asking me to set a team ID.
It looks like Xcode 13.3 beta now imposes the same requirement on resource bundles even when building for iOS, not Mac Catalyst.
UPD: I tried
CODE_SIGN_IDENTITY[sdk=iphone*]='-'
but it didn't help, Xcode is still asking me to set a team ID.
+1
The newly introduced iOS behavior has been reported to Apple as FB9874350.
I want to confirm I have exactly same issue when compiling for iOS device under Xcode 13.3 beta 2 :(
I set manually each Pod project having error with team signing. And it works now.
Thanks @JeffGuKang
On my side, I didn't have the tab "Signing & Capabilities" for the Pod, I had to set the "Development Team" in build settings for this Pod.
Setting the "Development Team" didn't work for me unfortunately.
The newly introduced iOS behavior has been reported to Apple as FB9874350.
@nikolaykasyanov Is that radar still open? I can't seem to find it.
Good news, seems to be fixed with Xcode 13.3 RC!
@monchote I didn't cross-post it to openradar or anywhere, sorry.
Lots of people solved lots of problems! I solved a few just yesterday. For this specific problem, the comment above worked for me: https://github.com/CocoaPods/CocoaPods/issues/8891#issuecomment-573301570
I think you'll need to post a great deal more information in order for anything useful to come from your comments, like a future solution. https://stackoverflow.com/help/how-to-ask / https://stackoverflow.com/help/minimal-reproducible-example
This now again happens with Xcode 14 beta. https://github.com/CocoaPods/CocoaPods/issues/8891#issuecomment-573301570 did not work for me.
I have never had it work consistently with 13.3 or 14rc without the signing workaround, personally. I just leave it on in my testing harness
This now again happens with Xcode 14 beta. #8891 (comment) did not work for me.
+1
I set manually each Pod project having error with team signing. And it works now.
you need to set 'DEVELOPMENT_TEAM' with you team id, not team name
This now again happens with Xcode 14 beta. #8891 (comment) did not work for me.
+1
Only set teamid to fix. this code work for me, xcode14 beta2。
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| if config.name != "Release" config.build_settings['DEVELOPMENT_TEAM'] = " debugTeamId. " else config.build_settings['DEVELOPMENT_TEAM'] = " releaseTeamId. " end end end end
Only set teamid to fix. this code work for me, xcode14 beta2。
post_install do |installer| # Get main project development team id dev_team = "" project = installer.aggregate_targets[0].user_project project.targets.each do |target| target.build_configurations.each do |config| if dev_team.empty? and !config.build_settings['DEVELOPMENT_TEAM'].nil? dev_team = config.build_settings['DEVELOPMENT_TEAM'] end end end
# Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally'
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['DEVELOPMENT_TEAM'] = dev_team
end
end
end
end
Hello,
This error now happens again with Xcode 14 beta 4.
Workaround with Podfile works: #8891 (comment)
fix
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
fix
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
This work with Xcode 14
fix
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
If the error doesn't fix after this change, run pod install
.
Is it still needed with the public Xcode 14 release?
Is it still needed with the public Xcode 14 release?
Yes.
just update 14.0.1 RC, still need
Im with Xcode 14 and with the same problem. I have five dependencies with this error when execute pod install
.
The product_type
in the fix below need be changed one by one that error happen or it is generic?
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" # <--- this
target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
end
The code above fix for all dependencies together. Thanks.
fixar
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
l
Friends, I add this code inside the block >
source 'https://github.com/CocoaPods/Specs.git' source 'https://cdn.cocoapods.org/' platform :ios, '11.0' use_frameworks! target 'KAccess' do project 'KAccess.xcodeproj' pod 'PhoneNumberKit', '~> 3.3' pod 'Firebase/Core', '9.1.0' pod 'Firebase/Auth', '9.1.0' pod 'Firebase/Messaging', '9.1.0' pod 'Firebase/Performance', '9.1.0' pod 'Firebase/RemoteConfig', '9.1.0' pod 'Firebase/InAppMessaging', '9.1.0' pod 'Firebase/Firestore', '9.1.0' pod 'Firebase/Crashlytics', '9.1.0' pod 'Firebase/Functions', '9.1.0' pod 'Firebase/Installations', '9.1.0' pod 'GoogleSignIn', '6.2.1' pod 'GoogleTagManager', '7.4.1' end
Sorry, I'm not a native developer so something is beyond my knowledge.
Post your code as code with markdown char.
Put the post install code in the end of your file Podfile
.
Podspec resource bundles now require a development team / signing identity. I think this only affects static libraries with resource bundles and not when the resources are bundled within a framework.
I will take a look at the Pods project diff to see what keys need to be added and update this issue. Maybe this will require an update to the Xcodeproj gem?
Default after
pod install
Manually modified Pods project resolves the issue
Originally posted by @chrisballinger in https://github.com/CocoaPods/CocoaPods/issues/8877#issuecomment-499359485
Workaround
Workaround available by Podfile hack here: https://github.com/CocoaPods/CocoaPods/issues/8891#issuecomment-546636698