错误:不支持 SWIFT_VERSION '5.0',支持的版本是:3.0、4.0、4.2.(在目标“红蜘蛛"中) [英] error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'Starscream')

查看:25
本文介绍了错误:不支持 SWIFT_VERSION '5.0',支持的版本是:3.0、4.0、4.2.(在目标“红蜘蛛"中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

重新创建的步骤

$ vue init nativescript-vue/vue-cli-template transport
$ cd transport
$ npm install
$ tns run ios --bundle

日志错误:

error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'Starscream')
note: Using new build systemnote: Planning buildnote: Constructing build description
** ARCHIVE FAILED **

Mac OS High Sierra 10.13.6Darwin Aerosol.local 17.7.0 Darwin Kernel 版本 17.7.0:2019 年 2 月 27 日星期三 00:43:23 PST;根:xnu-4570.71.35~1/RELEASE_X86_64 x86_64

Mac OS High Sierra 10.13.6 Darwin Aerosol.local 17.7.0 Darwin Kernel Version 17.7.0: Wed Feb 27 00:43:23 PST 2019; root:xnu-4570.71.35~1/RELEASE_X86_64 x86_64

node -v v11.7.0npm -v 6.9.0vue -v 3.6.3

node -v v11.7.0 npm -v 6.9.0 vue -v 3.6.3

我能够创建新应用并在我的 iOS 设备上运行它们,但由于某种原因,过去 1-2 周情况发生了变化.看起来我不能再开发 NativeScript 应用程序了.有什么提示吗?

I was able to create new apps and run them on my iOS devices but for some reason things have changed last 1-2 week. It looks like I can not develop NativeScript apps anymore. Any hints?

推荐答案

如果您在构建时遇到 SWIFT_VERSION 问题,您可以手动配置它,将 PodFile 添加到您的项目 (App_Resources/iOS) 中,设置您想要的版本,例如PodFile 中的这个应该可以解决您的问题

if you have problems with SWIFT_VERSION on the build you can configure manually it adding a PodFile to your project (App_Resources/iOS) setting the version you want, something like this in the PodFile should solve your problem

pre_install 
do |installer|
    installer.analysis_result.specifications.each 
    do |s|
        if s.name == 'Starscream'
            s.swift_version = '4.2'
        end
    end
end

希望能帮到你

对不起,我搞错了……这是正确的 PodFile

Sorry man, I make a mistake in... this is the correct PodFile

pre_install do |installer|
    installer.analysis_result.specifications.each do |s|
        if s.name == 'Starscream'
            s.swift_version = '4.2'
        end
    end
end

这篇关于错误:不支持 SWIFT_VERSION '5.0',支持的版本是:3.0、4.0、4.2.(在目标“红蜘蛛"中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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