Flutter-SWIFT_VERSION必须设置为支持的值 [英] Flutter - SWIFT_VERSION must be set to a supported value

查看:239
本文介绍了Flutter-SWIFT_VERSION必须设置为支持的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试库simple_permission,修复了pod错误,但出现此错误,不知道如何进行.快速版本在构建设置"中没有设置,我尝试添加它,但是没有用.

Trying out the library simple_permission, fixed the pod error and this came up, no idea how to proceed. There's no setting for the swift version in Build Settings, I tried adding it, but it didn't work.

Launching lib/main.dart on iPhone X in debug mode...
Skipping compilation. Fingerprint match.
Running Xcode clean...
Starting Xcode build...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **

Xcode's output:
↳
=== BUILD TARGET simple_permissions OF PROJECT Pods WITH CONFIGURATION             Debug ===
    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.
Could not build the application for the simulator.
Error launching application on iPhone X.

推荐答案

检查此答案.

使用Swift对插件的iOS部分进行编码时,您必须对ios/Podfile进行更改.您必须添加use_frameworks!config.build_settings['SWIFT_VERSION'] = '4.1'.

When the iOS part of a plugin is coded using Swift, you must make that change to your ios/Podfile. You must add use_frameworks! and config.build_settings['SWIFT_VERSION'] = '4.1'.

target 'Runner' do
  use_frameworks!  # required by simple_permission
  ...
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.1'  # required by simple_permission
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

您可以在该问题中检查所需的SWIFT_VERSION 问题是使用3.2解决的.在我发布的答案中,建议使用4.1,但4.0也可以.

You might check which SWIFT_VERSION will be required, in that issue, the problem is solved using 3.2. In the answer I posted, 4.1 was recommended but 4.0 also worked.

这篇关于Flutter-SWIFT_VERSION必须设置为支持的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆