0

I am working on a cordova app and using PhoneGap build to compile for iOS. I have added the <plugin name="cordova-plugin-simple-file-chooser" /> to my app but for some reason it is causing the build to fail on PhoneGap build, and I get this error

The “Swift Language Version” (The “Swift Language Version” (SWIFT_VERSION) build setting must 
be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. 
This setting can be set in the build settings editor. T) build setting must be set to a 
supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This 
setting can be set in the build settings editor.

If I remove the plugin the build succeeds. I have searched the web, and I have found a lot of similar scenarios, but most of them involve using Xcode, and not PhoneGap build. I do not have a Mac, so I am not sure what to do to fix this. Everything is working just fine on Android. I really need this plugin and I am running low on time. If anybody has any suggestions about how I can fix this, or a different plugin, I would greatly appreciate it.

Note: I am currently not using this plugin in my code, because I cannot get it to compile, so I have no code to show

yCombinator
  • 113
  • 4
  • 15

1 Answers1

0

I use Cordova in my Ionic project and set the swift version in the following way. I hope this helps you as well.

By default, the Swift 4 support is added but the legacy version (2.3) can still be configured as a preference, inside the project's config.xml, within the <platform name="ios"> section:

<preference name="UseLegacySwiftLanguageVersion" value="true" />

Or it is possible to specify the version as following, inside the project's config.xml, within the <platform name="ios"> section:

<preference name="UseSwiftLanguageVersion" value="5" />

Your plugin is using this swift dependency, you can check this link for more info: https://www.npmjs.com/package/cordova-plugin-add-swift-support

Durga Vundavalli
  • 1,790
  • 22
  • 26