7

What am I missing here? There is nowhere an instruction to compile for ios 11..

Swift Compiler Error (Xcode): Compiling for iOS 11.0, but module 'PhoneNumberKit' has a minimum deployment target of iOS 12.0: /Users/aris/Library/Developer/Xcode/DerivedData/Runner-cmtnerpxiupormgiakqsqxlnezts/Build/Intermediates.noindex/ArchiveIntermediates/Runner/Build ProductsPath/Release-iphoneos/PhoneNumberKit/PhoneNumberKit.framework/Modules/PhoneNumberKit.swiftmodule/arm64-apple-ios.swiftmodule /Users/aris/.pub-cache/hosted/pub.dev/libphonenumber_plugin-0.3.2/ios/Classes/SwiftLibphonenumberPlugin.swift:2:7

Things I have tried:

  1. clear build folder from Xcode and run again pod install
  2. pod install --repo-update
  3. Podfile has first line as target ios: 14
  4. Xcode target -> runner -> build settings -> ios build target 14
  5. flutter clean; flutter pug get; flutter build ipa
  6. flutter upgrade and re-install all pods
  7. delete derived folder of Xcode
2
  • The error message you're seeing indicates that you're trying to compile your iOS app with a deployment target of iOS 11.0, but one of the dependencies, which is PhoneNumberKit, has a minimum deployment target of iOS 12.0. This discrepancy in deployment targets is causing a conflict. Commented Sep 25, 2023 at 5:13
  • but my min deployment target is 14. can you tell me where to fix it? Commented Sep 25, 2023 at 8:11

1 Answer 1

15

I got this exact error with PhoneNumberKit:

Could not build the precompiled application for the device. Swift Compiler Error (Xcode): Compiling for iOS 11.0, but module 'PhoneNumberKit' has a minimum deployment target of iOS 12.0:

Update your ios/Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # Do either this:
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
      # or this:
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
end

Thanks to https://stackoverflow.com/a/64075795 and https://stackoverflow.com/a/64072195

Sign up to request clarification or add additional context in comments.

1 Comment

awesome thanks. the fact that we have to manually do these shenanigans is disheartening though :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.