Skip to content

Commit d56cfcd

Browse files
jmagmanTecHaxter
authored andcommitted
[google_sign_in_ios] Upgrade GoogleSignIn iOS SDK to 7.1 (flutter#6404)
1. Update GoogleSignIn iOS SDK dependency to [7.1](https://github.com/google/GoogleSignIn-iOS/releases/tag/7.1.0), which supports privacy manifests. 1. Update "fetch deps step" to run `pod repo update` every time to avoid missing spec failure. Also added a fetch deps step to the all_packages builds, since those could also use a `pod repo update` but I didn't want to add more logic to those bash scripts. ``` [!] CocoaPods could not find compatible versions for pod "GoogleSignIn": In Podfile: google_sign_in_ios (from `Flutter/ephemeral/.symlinks/plugins/google_sign_in_ios/darwin`) was resolved to 0.0.1, which depends on GoogleSignIn (~> 7.1) None of your spec sources contain a spec satisfying the dependency: `GoogleSignIn (~> 7.1)`. ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8752192509749702705/+/u/Run_package_tests/download_Dart_and_iOS_deps/stdout 3. Looks like the new versions of [`GTMSessionFetcher`](https://github.com/CocoaPods/Specs/blob/master/Specs/c/e/3/GTMSessionFetcher/3.3.2/GTMSessionFetcher.podspec.json) and [`AppAuth`](https://github.com/CocoaPods/Specs/blob/master/Specs/b/b/9/AppAuth/1.7.3/AppAuth.podspec.json) don't define modules, so there's an error building it statically: ``` [!] The following Swift pods cannot yet be integrated as static libraries: The Swift pod `GTMAppAuth` depends upon `GTMSessionFetcher` and `AppAuth`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies. ``` I filed google/gtm-session-fetcher#384 and openid/AppAuth-iOS#844. In the meantime, I updated the example apps to `use_frameworks!`, which would be on for Flutter Swift apps, but not Objective-C ones. We could add something to the tool to detect this case, and suggest `use_frameworks!` be added? 4. Even though google_sign_in_ios does not contain Swift files, for some reason, there is a "pod lib lint" warning complaining `swift_version` isn't set. This seems related to `GTMAppAuth` dependency constraint that went from an Objective-C-only to Swift pod. So I set `swift_version` since it's harmless. ``` - WARN | swift: The validator used Swift `4.0` by default because no Swift version was specified. To specify a Swift version during validation, add the `swift_versions` attribute in your podspec. Note that usage of a `.swift-version` file is now deprecated. ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8752100979634945505/+/u/Run_package_tests/validate_iOS_and_macOS_podspecs/stdout ## Issues * Fixes flutter/flutter#145777 * Fixes flutter/flutter#145866 * See also flutter/flutter#137140
1 parent 0dfcfbc commit d56cfcd

File tree

9 files changed

+65
-15
lines changed

9 files changed

+65
-15
lines changed

.ci/targets/ios_build_all_packages.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ tasks:
22
- name: prepare tool
33
script: .ci/scripts/prepare_tool.sh
44
infra_step: true # Note infra steps failing prevents "always" from running.
5+
- name: download Dart and iOS deps
6+
script: .ci/scripts/tool_runner.sh
7+
args: ["fetch-deps", "--ios", "--supporting-target-platforms-only"]
8+
infra_step: true
59
- name: create all_packages app
610
script: .ci/scripts/create_all_packages_app.sh
711
infra_step: true # Note infra steps failing prevents "always" from running.

.ci/targets/macos_build_all_packages.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ tasks:
22
- name: prepare tool
33
script: .ci/scripts/prepare_tool.sh
44
infra_step: true # Note infra steps failing prevents "always" from running.
5+
- name: download Dart and macOS deps
6+
script: .ci/scripts/tool_runner.sh
7+
args: ["fetch-deps", "--macos", "--supporting-target-platforms-only"]
8+
infra_step: true
59
- name: create all_packages app
610
script: .ci/scripts/create_all_packages_app.sh
711
infra_step: true # Note infra steps failing prevents "always" from running.

packages/google_sign_in/google_sign_in_ios/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 5.7.6
2+
3+
* Upgrades GoogleSignIn iOS SDK to 7.1.
4+
15
## 5.7.5
26

37
* Pins GoogleSignIn to iOS SDK "7.0.0" while preparing the update to 7.1.

packages/google_sign_in/google_sign_in_ios/darwin/google_sign_in_ios.podspec

+12-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,23 @@ Enables Google Sign-In in Flutter apps.
1515
s.source_files = 'Classes/**/*.{h,m}'
1616
s.public_header_files = 'Classes/**/*.h'
1717
s.module_map = 'Classes/FLTGoogleSignInPlugin.modulemap'
18-
s.dependency 'GoogleSignIn', '~> 7.0.0'
18+
19+
# AppAuth and GTMSessionFetcher are GoogleSignIn transitive dependencies.
20+
# Depend on versions which defines modules.
21+
s.dependency 'AppAuth', '>= 1.7.4'
22+
s.dependency 'GTMSessionFetcher', '>= 3.4.0'
23+
s.dependency 'GoogleSignIn', '~> 7.1'
1924
s.static_framework = true
2025
s.ios.dependency 'Flutter'
2126
s.osx.dependency 'FlutterMacOS'
2227
s.ios.deployment_target = '12.0'
2328
s.osx.deployment_target = '10.15'
2429
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
30+
31+
# google_sign_in_ios does not contain Swift files. For some reason, there
32+
# is a "pod lib lint" warning unless swift_version is set. This seems related to
33+
# GoogleSignIn depending a Swift pod (GTMAppAuth).
34+
s.swift_version = '5.0'
35+
2536
s.resource_bundles = {'google_sign_in_ios_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
2637
end

packages/google_sign_in/google_sign_in_ios/example/ios/Runner.xcodeproj/project.pbxproj

+9-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
97C146E61CF9000F007C117D /* Project object */ = {
274274
isa = PBXProject;
275275
attributes = {
276-
LastUpgradeCheck = 1430;
276+
LastUpgradeCheck = 1510;
277277
ORGANIZATIONNAME = "The Flutter Authors";
278278
TargetAttributes = {
279279
97C146ED1CF9000F007C117D = {
@@ -386,11 +386,19 @@
386386
);
387387
inputPaths = (
388388
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
389+
"${PODS_CONFIGURATION_BUILD_DIR}/AppAuth/AppAuthCore_Privacy.bundle",
390+
"${PODS_CONFIGURATION_BUILD_DIR}/GTMAppAuth/GTMAppAuth_Privacy.bundle",
391+
"${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher/GTMSessionFetcher_Core_Privacy.bundle",
392+
"${PODS_CONFIGURATION_BUILD_DIR}/GTMSessionFetcher/GTMSessionFetcher_Full_Privacy.bundle",
389393
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleSignIn/GoogleSignIn.bundle",
390394
"${PODS_CONFIGURATION_BUILD_DIR}/google_sign_in_ios/google_sign_in_ios_privacy.bundle",
391395
);
392396
name = "[CP] Copy Pods Resources";
393397
outputPaths = (
398+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AppAuthCore_Privacy.bundle",
399+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMAppAuth_Privacy.bundle",
400+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMSessionFetcher_Core_Privacy.bundle",
401+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GTMSessionFetcher_Full_Privacy.bundle",
394402
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleSignIn.bundle",
395403
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/google_sign_in_ios_privacy.bundle",
396404
);

packages/google_sign_in/google_sign_in_ios/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

packages/google_sign_in/google_sign_in_ios/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_sign_in_ios
22
description: iOS implementation of the google_sign_in plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_ios
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
5-
version: 5.7.5
5+
version: 5.7.6
66

77
environment:
88
sdk: ^3.2.3

script/tool/lib/src/fetch_deps_command.dart

+18-11
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import 'common/repository_package.dart';
1111

1212
const int _exitPrecacheFailed = 3;
1313
const int _exitNothingRequested = 4;
14+
const int _exitPodUpdateFailed = 5;
1415

1516
/// Download dependencies, both Dart and native.
1617
///
@@ -79,22 +80,28 @@ class FetchDepsCommand extends PackageLoopingCommand {
7980
// `pod install` requires having the platform artifacts precached. See
8081
// https://github.com/flutter/flutter/blob/fb7a763c640d247d090cbb373e4b3a0459ac171b/packages/flutter_tools/bin/podhelper.rb#L47
8182
// https://github.com/flutter/flutter/blob/fb7a763c640d247d090cbb373e4b3a0459ac171b/packages/flutter_tools/bin/podhelper.rb#L130
82-
if (getBoolArg(platformIOS)) {
83-
final int exitCode = await processRunner.runAndStream(
83+
final bool precacheIOS = getBoolArg(platformIOS);
84+
final bool precacheMacOS = getBoolArg(platformMacOS);
85+
if (precacheIOS || precacheMacOS) {
86+
final int precacheExitCode = await processRunner.runAndStream(
8487
flutterCommand,
85-
<String>['precache', '--ios'],
88+
<String>[
89+
'precache',
90+
if (precacheIOS)
91+
'--ios',
92+
if (precacheMacOS)
93+
'--macos',
94+
],
8695
);
87-
if (exitCode != 0) {
96+
if (precacheExitCode != 0) {
8897
throw ToolExit(_exitPrecacheFailed);
8998
}
90-
}
91-
if (getBoolArg(platformMacOS)) {
92-
final int exitCode = await processRunner.runAndStream(
93-
flutterCommand,
94-
<String>['precache', '--macos'],
99+
final int updateUpdateExitCode = await processRunner.runAndStream(
100+
'pod',
101+
<String>['repo', 'update'],
95102
);
96-
if (exitCode != 0) {
97-
throw ToolExit(_exitPrecacheFailed);
103+
if (updateUpdateExitCode != 0) {
104+
throw ToolExit(_exitPodUpdateFailed);
98105
}
99106
}
100107
}

script/tool/test/fetch_deps_command_test.dart

+12
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@ void main() {
409409
<String>['precache', '--ios'],
410410
null,
411411
),
412+
const ProcessCall(
413+
'pod',
414+
<String>['repo', 'update'],
415+
null,
416+
),
412417
for (final Directory directory in exampleDirs)
413418
ProcessCall(
414419
'flutter',
@@ -436,6 +441,7 @@ void main() {
436441
.mockProcessesForExecutable[getFlutterCommand(mockPlatform)] =
437442
<FakeProcessInfo>[
438443
FakeProcessInfo(MockProcess(), <String>['precache']),
444+
FakeProcessInfo(MockProcess(), <String>['repo', 'update']),
439445
FakeProcessInfo(MockProcess(exitCode: 1),
440446
<String>['build', 'ios', '--config-only']),
441447
];
@@ -516,6 +522,11 @@ void main() {
516522
<String>['precache', '--macos'],
517523
null,
518524
),
525+
const ProcessCall(
526+
'pod',
527+
<String>['repo', 'update'],
528+
null,
529+
),
519530
for (final Directory directory in exampleDirs)
520531
ProcessCall(
521532
'flutter',
@@ -543,6 +554,7 @@ void main() {
543554
.mockProcessesForExecutable[getFlutterCommand(mockPlatform)] =
544555
<FakeProcessInfo>[
545556
FakeProcessInfo(MockProcess(), <String>['precache']),
557+
FakeProcessInfo(MockProcess(), <String>['repo', 'update']),
546558
FakeProcessInfo(MockProcess(exitCode: 1),
547559
<String>['build', 'macos', '--config-only']),
548560
];

0 commit comments

Comments
 (0)