Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Sep 16, 2022

Bundles can contain resources like images and localization files. They are embedded in the framework and should not be codesigned. Xcode 14 changed behavior and is erroneously codesigning these. CocoaPods has not yet added a workaround on their side CocoaPods/CocoaPods#11402.

Confirms this also works for add-to-app hosts.

Fixes #111475

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@jmagman jmagman self-assigned this Sep 16, 2022
@flutter-dashboard flutter-dashboard bot added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Sep 16, 2022
@jmagman jmagman marked this pull request as ready for review September 16, 2022 17:08
'pod',
<String>['repo', 'update'],
environment: <String, String>{
'LANG': 'en_US.UTF-8',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what kind of bad things could happen if we don't override the LANG?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A harmless warning #45710 CocoaPods/CocoaPods#9347
The tool does this


but this is invoked outside the tool. The fewer avoidable warnings in the logs the better, imo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, I fixed this at some point, exec, eval are getting LANG added later: #82308

/// adding Flutter to an existing iOS app.
Future<void> main() async {
await task(() async {
// Update pod repo.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[module_test_ios] [STDOUT] stdout:                [!] CocoaPods could not find compatible versions for pod "GoogleSignIn":
[module_test_ios] [STDOUT] stdout:                  In Podfile:
[module_test_ios] [STDOUT] stdout:                    google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`) was resolved to 0.0.1, which depends on
[module_test_ios] [STDOUT] stdout:                      GoogleSignIn (~> 6.2)
[module_test_ios] [STDOUT] stdout: 
[module_test_ios] [STDOUT] stdout:                None of your spec sources contain a spec satisfying the dependency: `GoogleSignIn (~> 6.2)`.

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8802907618391831937/+/u/run_module_test_ios/test_stdout

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I should start inline commenting failing builds on my fix PRs.

'CODE_SIGN_IDENTITY=-',
'EXPANDED_CODE_SIGN_IDENTITY=-',
'CONFIGURATION_BUILD_DIR=${objectiveCBuildDirectory.path}',
'BUILD_DIR=${objectiveCBuildDirectory.path}',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILD_DIR is used to construct CONFIGURATION_BUILD_DIR, as well as a few other build settings that were required to move the resource bundle to the right place.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I asked what this was right after you commented, thanks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have submitted them before requesting review. You're too speedy 🙂

Comment on lines +214 to +215
// Resources should be embedded.
checkDirectoryExists(path.join(ephemeralIOSHostApp.path, 'Frameworks', 'GoogleSignIn.framework', 'GoogleSignIn.bundle'));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resources are localized string files, btw

Comment on lines 322 to +323
objectiveCBuildDirectory.path,
'Debug-iphoneos',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILD_DIR doesn't include Debug-iphoneos so now it's being added.

@jmagman jmagman changed the title Do not codesign transitive dependency pod libraries Do not codesign transitive dependency pod resource bundles Sep 16, 2022
@jmagman jmagman changed the title Do not codesign transitive dependency pod resource bundles Do not codesign transitive dependency iOS pod resource bundles Sep 16, 2022
Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jmagman jmagman added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 16, 2022
@auto-submit auto-submit bot merged commit 7714a8d into flutter:master Sep 16, 2022
@jmagman jmagman deleted the pod-sign-libs branch September 16, 2022 18:03
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 16, 2022
jmagman added a commit to jmagman/flutter that referenced this pull request Sep 16, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Sep 16, 2022
@radvansky-tomas
Copy link

ETA to release this to stable channel ?

@jmagman
Copy link
Member Author

jmagman commented Sep 22, 2022

Soon, this has already merged into the next hotfix branch: #111759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signing errors on iOS pod bundle resources on Xcode 14 "Signing for "x" requires a development team."

3 participants