Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7643ef1

Browse files
authored
iOS: Eliminate unguarded-availability opt-out (#56689)
Eliminates the opt-out of `-Wunguarded-availability-new` in the `ios_test_flutter` target. Xcode 15 beta XCTest framework headers contained unguarded usage of iOS 17 API. This bug resulted in engine build failures. This was fixed in a later XCTest framework release. ``` /Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIAccessibilityAuditTypes.h:19:30: error: 'XCUIAccessibilityAuditType' is only available on iOS 17.0 or newer [-Werror,-Wunguarded-availability-new] 19 | typedef NS_OPTIONS(uint64_t, XCUIAccessibilityAuditType) { | ^ /Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIAccessibilityAuditTypes.h:19:30: note: 'XCUIAccessibilityAuditType' has been marked as being introduced in iOS 17.0 here, but the deployment target is iOS 13.0.0 /Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIAccessibilityAuditTypes.h:19:9: note: annotate anonymous enum with an availability attribute to silence this warning 19 | typedef NS_OPTIONS(uint64_t, XCUIAccessibilityAuditType) { | ^ /Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:383:34: note: expanded from macro 'NS_OPTIONS' 383 | #define NS_OPTIONS(_type, _name) CF_OPTIONS(_type, _name) | ^ /Applications/Xcode_15-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:155:96: note: expanded from macro 'CF_OPTIONS' 155 | #define CF_OPTIONS(_type, _name) __attribute__((availability(swift,unavailable))) _type _name; enum __CF_OPTIONS_ATTRIBUTES : _name | ``` Issue: flutter/flutter#128958 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent b9b57a9 commit 7643ef1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

shell/platform/darwin/ios/BUILD.gn

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,8 @@ shared_library("ios_test_flutter") {
199199
testonly = true
200200
visibility = [ "*" ]
201201

202-
# Xcode 15 beta has a bug where iOS 17 API usage is not guarded.
203-
# This bug results engine build failure since the engine treats warnings as errors.
204-
# The `-Wno-unguarded-availability-new` can be removed when the Xcode bug is fixed.
205-
# See details in https://github.com/flutter/flutter/issues/128958.
206202
cflags_objc = flutter_cflags_objc
207-
cflags_objcc = flutter_cflags_objcc + [ "-Wno-unguarded-availability-new" ]
203+
cflags_objcc = flutter_cflags_objcc
208204
cflags = [
209205
"-fvisibility=default",
210206
"-F$platform_frameworks_path",

0 commit comments

Comments
 (0)