错误:不支持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')

查看:122
本文介绍了错误:不支持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:PST 2019年2月27日星期三00:43:23;根目录: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

节点-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

我希望这可以为您提供帮助

I wish this can help you

对不起,我在输入错误...这是正确的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天全站免登陆