natintosh / plugin_libphonenumber

MIT License
5 stars 30 forks source link

iOS 17 & Xcode 15.0 (R.C.) - Swift Compiler Error (Xcode) PhoneNumberKit from 11.0 to 12.0 #29

Open kekko7072 opened 9 months ago

kekko7072 commented 9 months ago

I use this flutter plugin and i'm getting this error with iOS 17 and Xcode 15 - RC.


Swift Compiler Error (Xcode): Compiling for iOS 11.0, but module 'PhoneNumberKit' has a minimum deployment target of iOS 12.0: /Users/francescovezzani/Developer/TomorrowTech/software/app/management/build/ios/Debug-dev-iphonesimulator/PhoneNumberKit/PhoneNumberKit.framework/Modules/PhoneNumberKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
/Users/francescovezzani/.pub-cache/hosted/pub.dev/libphonenumber_plugin-0.3.2/ios/Classes/SwiftLibphonenumberPlugin.swift:2:7

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.
`
Can you deploy a fix?
kekko7072 commented 9 months ago

I changed my ios/Podfile file for a temporary fix.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
# START - Temporary Fix
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
# END - Temporary Fix
        xcconfig_path = config.base_configuration_reference.real_path
        xcconfig = File.read(xcconfig_path)
        xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
        File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
    end
  end
end

Then do this to make changes:

  1. Run flutter clean
  2. Delete Podfile.lock
fwilliamconceicao commented 9 months ago

Does anyone will check this?

This lib is being a quite headache in the last 2 months at least having a lot issues with compatibilities.

fwilliamconceicao commented 9 months ago

I changed my ios/Podfile file for a temporary fix.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
# START - Temporary Fix
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
# END - Temporary Fix
        xcconfig_path = config.base_configuration_reference.real_path
        xcconfig = File.read(xcconfig_path)
        xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
        File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
    end
  end
end

Then do this to make changes:

  1. Run flutter clean
  2. Delete Podfile.lock

@kekko7072 in fact there's already a PR open for this: https://github.com/natintosh/plugin_libphonenumber/pull/28