Build problems with scandit-cordova-datacapture-barcode plugin


I’m trying to create an app with the scandit-cordova-datacapture-barcode plugin but the build fails with error:

xcodebuild: Command failed with exit code 65

According to Scandit support the reason is target integrity check returns these errors for embedded frameworks from Xcode 12.3. They think that setting a certain build flag will resolve the issue ( VALIDATE_WORKSPACE = YES).

Is it possible to add these kind of build flags to the application package I upload on VoltBuilder and if so, how?

(VoltBuilder uses Xcode 12.4 now - we’ll probably go to 12.5 tomorrow)

Looking at the log, I see some more information:

/platforms/ios/TESS THM Mobile NG iOS/Plugins/scandit-cordova-datacapture-core/ScanditCaptureCore.swift:48:39: error: cannot find type 'VolumeButtonObserver' in scope
    private var volumeButtonObserver: VolumeButtonObserver?
/platforms/ios/TESS THM Mobile NG iOS/Plugins/scandit-cordova-datacapture-core/ScanditCaptureCore.swift:114:30: error: type of expression is ambiguous without more context
        volumeButtonObserver = nil
/platforms/ios/TESS THM Mobile NG iOS/Plugins/scandit-cordova-datacapture-core/ScanditCaptureCore.swift:207:32: error: cannot find 'VolumeButtonObserver' in scope
        volumeButtonObserver = VolumeButtonObserver(handler: { [weak self] in
/platforms/ios/TESS THM Mobile NG iOS/Plugins/scandit-cordova-datacapture-core/ScanditCaptureCore.swift:220:30: error: type of expression is ambiguous without more context
        volumeButtonObserver = nil

Can you see if Scandi has further information on this message?


reply from Scandit support says:

The cause of the provided warnings might be the fact that your app is using a Swift version other than 4.0 (which is the only version we support) despite setting it in config.xml.

I’ve tried these settings in config.xml to no avail:

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

By default, cordova-plug-swift uses the version of Swift that is in the installed copy of Xcode. We’re using the latest version (12.5), so here’s the default Swift:

Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
Target: x86_64-apple-darwin20.4.0

However, it looks like you’re doing the right steps to get VoltBuilder/Cordova/Xcode 12.5 to use Swift 4.0.

I think you need to ask for more help from Scandit. Have you asked Scandit if they plan to update their software?

This was the correct answer: Scandit had to update their software in order for me to use it with Voltbuilder. It now works like a charm.