Skip to content

Xcode 26 build error: Cannot find '__IPHONE_OS_VERSION_MIN_REQUIRED' in scope #4003

Open
@minlite

Description

@minlite

Describe the bug

Building a project that has the amplify dependency on Xcode 26 / iOS 26 results in the following error:

Cannot find '__IPHONE_OS_VERSION_MIN_REQUIRED' in scope

The culprit code seems to be in the AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/ASF/ASFAppInfo.swift file:

  var targetSDK: String {
        var targetSDK: String = ""
#if os(iOS) || os(watchOS) || os(tvOS)
        targetSDK = "\(__IPHONE_OS_VERSION_MIN_REQUIRED)"
#elseif os(macOS)
        targetSDK = "\(__MAC_OS_X_VERSION_MIN_REQUIRED)"
#else
        targetSDK = "Unknown"
#endif
        return targetSDK

Steps To Reproduce

1. Download Xcode 26
2. Add amplify sdk as dependency
3. Build

Expected behavior

Code builds without any issues

Amplify Framework Version

2.42.1

Amplify Categories

Auth

Dependency manager

Swift PM

Swift version

5.3

CLI version

NA

Xcode version

26 Dev Beta 1 (17A5241e)

Relevant log output

<details>
<summary>Log Messages</summary>


amplify-swift/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/ASF/ASFAppInfo.swift:19:24: error: cannot find '__IPHONE_OS_VERSION_MIN_REQUIRED' in scope
        targetSDK = "\(__IPHONE_OS_VERSION_MIN_REQUIRED)"

</details>

Is this a regression?

Yes

Regression additional context

No response

Platforms

iOS

OS Version

iOS 26 Dev Beta 1

Device

iPhone 15 Pro

Specific to simulators

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues related to build and CI/CDfeature-requestRequest a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions