1

Steps to recreate

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

Log error:

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.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.0 npm -v 6.9.0 vue -v 3.6.3

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?

user2401543
  • 1,059
  • 11
  • 19
  • Looks like you are running a lower version of Xcode than Starscream was targeted for, you could update your Xcode version to 10.3 which should have support for Swift 5. But you might have to make sure your other plugins support Swift 4 or later, I don't think Swift 3 will be supported in Xcode 10.3. So you might have to adjust accordingly later. – Manoj Jun 04 '19 at 11:02

4 Answers4

3

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

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
MCorzo
  • 154
  • 3
  • Hi MCorzo, thanks for help, but I am new to CocoaPods - so following your answer I have created Podfile in app/App_Resources/iOS with your script and then tried but failing: `$ pod install ` [!] Invalid `Podfile` file: syntax error, unexpected keyword_do_block, expecting end-of-input.`` – user2401543 Jun 03 '19 at 19:35
0

The last time I had issues with Swift versions an Pods, downgrading cocoapodsfrom 1.6.x to 1.5 resolved the issue:

    sudo gem uninstall cocoapods
    sudo gem install cocoapods -v 1.5.3

Looking at the release notes for cocoapods1.6 back in march showed some changes regarding this.

The error messages were different, though but it might be worth a try.

Tim
  • 212
  • 1
  • 7
0

I just realized that I do not have to start native app creation using vue init, ie

$ vue init nativescript-vue/vue-cli-template transport

but with tns create there is no problem at all, I can choose Vuejs without downloading template via vue

$ tns create myapp
user2401543
  • 1,059
  • 11
  • 19
0

I performed a very simple solution and it worked like wonder.

  1. Click on the project you intend to build under Project Navigator.
  2. Click on Build Settings -> Combined in General Setting pane.
  3. Change to the desired version from drop down under 'Swift Language Version'
  4. Build the project again. Voila !!!

Screen shot of the image