Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'SwiftyJSON')

I am getting this error while trying to install react-native-charts-wrapper. I have followed the steps exactly as they say but still not able to build the project successfully.

I also set the SWIFT_VERSION to 4.2 in build settings of my project, still getting the same error.

My XCODE version: Version 10.1 (10B61)

Any ideas?

like image 260
honor Avatar asked Apr 16 '19 14:04

honor


2 Answers

I found it. I am not familiar with XCode so it was not very straightforward for me. I clicked "Pods" on the project tree on the left, then clicked the dropdown to select SwiftyJSON from the list at the top left corner. Then changed the Swift version which was set to 5.0. See the image.

enter image description here

Cheers

like image 96
honor Avatar answered Nov 05 '22 07:11

honor


For anyone who's build continues to fail despite following the previous solution:

  1. Find SWIFT_VERSION literal in whole project files using IDE or editor – I turned on sublimetext, open project root directory, [Find] - [Find in Files.] – Search SWIFT_VERSION

  2. In my case some constants in projectfile was SWIFT_VERSION = 5.0 in proj.pbxproj file despite I changed swift_version on Xcode

    <code>SWIFT_VERSION = 5.0</code> in proj.pbxproj

  3. Change value you want and save file

  4. Restart Xcode

  5. Try Build

like image 6
gonnichiwa Avatar answered Nov 05 '22 06:11

gonnichiwa