'xxxx' does not specify a Swift version and none of the targets (Runner) integrating it have the ...

解决办法:

  1. 创建swift文件。使用Xcode打开Runner,


    'xxxx' does not specify a Swift version and none of the targets (Runner) integrating it have the ..._第1张图片
    1561365438383.jpg

快捷键Command+N,选择Swfit File,点击Next,弹出框选择,选择 Creat Bridge Header


'xxxx' does not specify a Swift version and none of the targets (Runner) integrating it have the ..._第2张图片
1561365630040.jpg


然后你的文件里会多出一个Runner-Bridging-Header.h头文件(之后可以删除刚才创建的swift文件,只需要这个头文件即可)

  1. 打开iOS目录下的Podfile文件,
    'xxxx' does not specify a Swift version and none of the targets (Runner) integrating it have the ..._第3张图片
    1561365116244.jpg

  添加 config.build_settings['SWIFT_VERSION'] = '4.2'

'xxxx' does not specify a Swift version and none of the targets (Runner) integrating it have the ..._第4张图片
1561365165912.jpg

  添加 use_frameworks!

  1. XCode -> Build Settings -> SWIFT_VERSION == 4.2
    'xxxx' does not specify a Swift version and none of the targets (Runner) integrating it have the ..._第5张图片
    1561366352611.jpg
  2. Android studio Terminal 执行 flutter clean
  3. 删除iOS -> Podfile.lock文件,


    'xxxx' does not specify a Swift version and none of the targets (Runner) integrating it have the ..._第6张图片
    1561366550672.jpg

    cd到iOS目录下,执行 pod install --repo-update。

IOS build error, need 'SWIFT_VERSION'

你可能感兴趣的:('xxxx' does not specify a Swift version and none of the targets (Runner) integrating it have the ...)