[英]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.