Skip to content

iOS build failed: target platform (12.0) is lower than required minimum platform (13.0) #135

@pr33ch

Description

@pr33ch

I am trying to use HomomorphicEncryption in my iOS project on Xcode 16.1 with minimum deployment iOS 18.0. After adding the swift-homomorphic-encryption (version 1.0.2) package as a package dependency using Xcode's package manager, I get the following error message when trying to build:

error: The package product 'Crypto' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'HomomorphicEncryption' from project 'swift-homomorphic-encryption')
error: The package product '_CryptoExtras' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'HomomorphicEncryption' from project 'swift-homomorphic-encryption')

When cloning the repo locally and trying to build it for iOS 18 (also using Xcode 16.1) in isolation without my own project, I get similar error messages, but with other package products requiring a min platform version of 16.0.

As a workaround, I can modify swift-homomorphic-encryption/Package.swift to include iOS(.v18) in package.platforms:

package.platforms = [
    .macOS(.v15), // Constrained by UInt128 support
    .iOS(.v18)
]

The project will then build successfully without the minimum platform version errors (and additional compiler complaints about specific features only being supported in iOS 18). With the above change, I can also successfully build my own project with the cloned repo as a local package dependency. What I'm wondering is:

  1. Is my workaround the right way of fixing the build issue? If so, maybe I could submit a pull request with my change.
  2. If not, what's the deeper underlying issue causing the build failure, and what would be the best way to fix the issue so that I can build my project with the swift-homomorphic-encryption package?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions