繁体   English   中英

cordova-plugins-qrscanner无法为ios构建

[英]cordova-plugins-qrscanner failed to build for ios

我有一个PhoneGap应用程序,我正在使用插件cordova-plugin-qrscanner

我的config.xml文件包括:

<plugin name="cordova-plugin-qrscanner" source="npm" spec="~3.0.1" />

我正在使用PhoneGap云构建构建应用程序( https://build.phonegap.com

在Android上构建它是成功的,应用程序正在运行没有问题

在iOS上我收到一个错误

Check dependencies
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.
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.

** ARCHIVE FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
Error: xcodebuild: Command failed with exit code 65
    at ChildProcess.whenDone (/private/project/cordova/node_modules/cordova-common/src/superspawn.js:135:23)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

我已经尝试添加swift支持插件

<plugin name="cordova-plugin-add-swift-support" source="npm" spec="~2.0.2" />

并指出如下的快速版本

<preference name="swift-version" value="3.0" />
<preference name="UseSwiftLanguageVersion" value="3" />

但是,仍然没有运气,我无法让它发挥作用

有什么建议么 ?

我找到了一个解决方案,我在这里发布给任何拥有相同内容的人

添加插件

<plugin name="cordova-plugin-qrscanner" source="npm" spec="~3.0.1" />

我将swift-version更改为4.2

<preference name="UseSwiftLanguageVersion" value="4" />
<preference name="SwiftVersion" value="4.2" />

我使用这一行添加了swift-support hook

<hook type="after_platform_add" src="plugins/cordova-plugin-qrscanner/scripts/swift-support.js" />

最后一个修复是在iOS'QRScanner.swift'内部(路径:src / ios / QRScanner.swift)

在openSettings函数中将“string:UIApplication.openSettingsURLString”更改为“string:UIApplicationOpenSettingsURLString”。 第470行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM