Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pr33ch opened this issue Nov 12, 2024 · 1 comment

Comments

@pr33ch
Copy link

pr33ch commented Nov 12, 2024

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?
@fboemer
Copy link
Contributor

fboemer commented Nov 14, 2024

Hi @pr33ch, thanks for your interest!

Yes, adding .iOS(.v18) would be how to add support for building on iOS.

However, swift-homomorphic-encryption isn't intended to be used for client-side crypto (see https://developer.apple.com/documentation/cryptokit for on-device crypto APIs), so we won't add .iOS(.v18) into the supported platform list at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants