尝试库 simple_permission,修复了 pod 错误,但出现了这个问题,不知道如何继续。 Build Settings里面没有设置swift版本,我试过加了,还是不行。
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.
最佳答案
检查 this answer .
当使用 Swift 编写插件的 iOS 部分时,您必须对 ios/Podfile
进行更改。您必须添加 use_frameworks!
和 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
您可以在 that issue 中检查需要哪个 SWIFT_VERSION
, 问题使用 3.2 解决。在我发布的答案中,建议使用 4.1,但也可以使用 4.0。
https://stackoverflow.com/questions/50458556/