bitpay / cordova-plugin-qrscanner

A fast, energy efficient, highly-configurable QR code scanner for Cordova apps and the browser.
MIT License
570 stars 773 forks source link

iOS can't build after migrate to swift 4.2 #257

Open SandroMoretti opened 5 years ago

SandroMoretti commented 5 years ago

I really can't build when using cordova-plugin-qrscanner@3.0.1

I'm using add-swift-support version 4.2, and x-code version 10.2.1 (in x-code, swift 4.2 is selected). My platform is ios@5.0.1

When I try build I get the follow errors:

error: QrScanner-Bridging-Header.h file not found 

The following build commands failed:
     PrecompileSwiftBridgingHeader normal armv7
     CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
     PrecompileSwiftBridgingHeader normal arm64

If I remove qrscanner plugin works perfectly.

There is my config.xml iOS:

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

And my plugin list:

cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-qrscanner 3.0.1 "QRScanner"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova.plugins.diagnostic 4.0.12 "Diagnostic"

Already tried with swift 4.2.0 and 5 too, not worked.

Please help?

cmgustavo commented 4 years ago

Try with this version of: <plugin name="cordova-plugin-add-swift-support" spec="1.7.2" />

SandroMoretti commented 4 years ago

Try with this version of: <plugin name="cordova-plugin-add-swift-support" spec="1.7.2" />

mac:OvoFacil Desenvolvimento$ cordova plugin
cordova-plugin-add-swift-support 1.7.2 "AddSwiftSupport"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-bluetooth-peripheral-usage-description 1.0.0 "Bluetooth Peripheral Usage Description"
cordova-plugin-bluetoothle 4.5.5 "Bluetooth LE"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-qrscanner 3.0.1 "QRScanner"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova.plugins.diagnostic 4.0.12 "Diagnostic"

Having same issue. Cordova version: 8.1.2 iOS platform version: 5.0.1

cmgustavo commented 4 years ago

Seems to be related to cordova-iOS version. I'm testing with 4.5.5. Version 5 has breaking changes (I guess).

jallen-dev commented 4 years ago

For ios 5.0.0+ try adding to config.xml:

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