Skip to content

[CP] Do not codesign transitive dependency iOS pod resource bundles #111757

@jmagman

Description

@jmagman

issue_link

#111475

Commit Hash

7714a8d

Target

stable

pr_link

#111759

Impacted Users

iOS developers using Xcode 14 who use plugins with resource bundles (images, localization strings), including google_sign_in plugin.

Impact Description

iOS developers on the newest version of Xcode using plugins with resource bundles like google_sign_in will not be able to build or release their apps. This is a regression caused by behavior changes in Xcode 14.

Re: low test coverage: I have tested the change, but this only really reproduces in an environment that codesigns the app. We generally do not do that in CI due to cert installation complications. I filed #111760 to prevent these issues in the future.

Workaround

#111475 (comment)

  1. Open ios/Podfile
  2. Replace the following:
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)

+   # Workaround https://github.com/flutter/flutter/issues/111475.
+   target_is_resource_bundle = target.respond_to?(:product_type) && target.product_type == 'com.apple.product-type.bundle'
+   target.build_configurations.each do |build_configuration|
+     if target_is_resource_bundle
+       build_configuration.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
+       build_configuration.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
+       build_configuration.build_settings['CODE_SIGNING_IDENTITY'] = '-'
+       build_configuration.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = '-'
+     end
+   end
  end
end

Risk

low

Test Coverage

no

Validation Steps

The following should succeed.

$ flutter create test_bundle
$ cd test_bundle
$ flutter pub add google_sign_in
$ flutter build ios --release

Failure looks like:

Error (Xcode): Signing for "GoogleSignIn-GoogleSignIn" requires a development
team. Select a development team in the Signing & Capabilities editor.

Metadata

Metadata

Assignees

Labels

cp: approvedApproved cherry-pick request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions