flutter_iap icon indicating copy to clipboard operation
flutter_iap copied to clipboard

The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift.

Open alamboley opened this issue 6 years ago • 4 comments

Hello,

Just added the plugin and got this error The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor. Which Swift version should also be used?

alamboley avatar Jul 02 '18 15:07 alamboley

I forget which one of these fixed the issue for me, but you can try the following: You also may need to run flutter clean and may also need to de-integrate the podfile and reinstall the pods. Sorry for the lack of specificity but one of these should do the trick!

  1. add use_frameworks!
target 'Runner' do
    use_frameworks!

  1. pre_install
pre_install do |installer|
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
  1. post_install
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ENABLE_BITCODE'] = 'NO'
            config.build_settings['SWIFT_VERSION']  = '3.2'
        end
        # workaround for https://github.com/CocoaPods/CocoaPods/issues/7463
        target.headers_build_phase.files.each do |file|
            file.settings = { 'ATTRIBUTES' => ['Public'] }
        end
    end
end

Edited for formatting

evanave avatar Jul 05 '18 09:07 evanave

I finally updated the plugin. It should fix this issue. Let me know if it does.

JackAppDev avatar Jul 05 '18 22:07 JackAppDev

Hey @JackAppDev , having the issue posted in #7.

Added

  1. add use_frameworks!
target 'Runner' do
    use_frameworks!

Does the trick, thanks @evanave !

alamboley avatar Jul 13 '18 09:07 alamboley

@alamboley could you open an issue in flutter's repo regarding plugins that use swift? I think this might be an issue they could fix.

JackAppDev avatar Jul 27 '18 20:07 JackAppDev