我正在开发一个cordova应用程序,并使用PhoneGap构建来编译iOS。我已经添加了 <plugin name="cordova-plugin-simple-file-chooser" />
到我的应用程序,但由于某些原因,它导致PhoneGap构建失败,我得到这个错误。
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.
如果我删除插件,构建成功。我在网上搜索了一下,发现了很多类似的情况,但大多数都是使用Xcode,而不是PhoneGap构建。我没有Mac,所以我不知道该怎么解决这个问题。一切都在Android上运行得很好。我真的需要这个插件,我的时间不多了。如果有人对我如何解决这个问题有任何建议,或者是不同的插件,我会非常感激。
注:目前我的代码中没有使用这个插件,因为我无法让它编译,所以我没有代码显示。
我在Ionic项目中使用了Cordova,并按以下方式设置了swift版本。希望对你也有帮助。
默认情况下,Swift 4支持被添加,但传统版本(2.3)仍然可以作为一个首选项配置,在项目的 config.xml
内,在 <platform name="ios">
部分。
<preference name="UseLegacySwiftLanguageVersion" value="true" />
或者可以在项目的 config.xml
内,在 <platform name="ios">
部分。
<preference name="UseSwiftLanguageVersion" value="5" />
你的插件正在使用这个swift依赖,你可以查看这个链接了解更多信息。https:/www.npmjs.compackagecordova-plugin-add-swift-support