Skip to content

Commit 0153456

Browse files
[CP-beta]Suppress deprecated iOS windows API in integration_test (#173304)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request) Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request. ### Issue Link: What is the link to the issue this cherry-pick is addressing? flutter/flutter#154365 (comment) ### Changelog Description: Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples Suppress an iOS deprecation warning to unblock Xcode 26 testing in CI ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch) Blocks Xcode 26 from being tested for the pacakges repo in CI flutter/flutter#170437 ### Workaround: Is there a workaround for this issue? No. Packages runs the Xcode analyzer against the Flutter master and stable branches, so this deprecation suppression must go to stable ASAP. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? Tested here: https://github.com/flutter/flutter/blob/de33a3b2ab94844b091e35cae1d30b853369d308/packages/integration_test/example/integration_test/matches_golden_test.dart#L43-L45 ### Validation Steps: What are the steps to validate that this fix works? Current CI analysis will pass with or without this suppression. However, we will no longer see failures like this in packages while upgrading to Xcode 26, or increasing the minimum target version. ``` integration_test/Sources/integration_test/IntegrationTestPlugin.m:76:55: error: 'windows' is deprecated: first deprecated in iOS 15.0 - Use UIWindowScene.windows on a relevant window scene instead [-Werror,-Wdeprecated-declarations] UIWindow *window = [UIApplication.sharedApplication.windows ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8738245141115055857/+/u/Run_package_tests/xcode_analyze_deprecation/stdout From flutter#7542
1 parent 659d955 commit 0153456

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/integration_test/ios/integration_test/Sources/integration_test/IntegrationTestPlugin.m‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
7979

8080
- (UIImage *)capturePngScreenshot {
8181
// Get all windows in the app
82+
#pragma clang diagnostic push
83+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
84+
// TODO(jmagman) Use scenes instead of deprecated windows. See
85+
// https://github.com/flutter/flutter/issues/154365
8286
NSArray<UIWindow *> *windows = [UIApplication sharedApplication].windows;
87+
#pragma clang diagnostic pop
8388

8489
// Find the overall bounding rect for all windows
8590
CGRect screenBounds = [UIScreen mainScreen].bounds;

0 commit comments

Comments
 (0)