Cordova-plugin-fingerprint-aio: SWIFT Support for Plugins

I am trying to use this plugin:
Cordova Plugin Fingerprint All-In-One

It uses SWIFT. The documentation says:
#Platforms

  • Android - Minimum SDK 23
  • iOS - XCode 9.2 or higher required
    • Please set <preference name="UseSwiftLanguageVersion" value="4.0" /> in your config.xml*

When I use VoltBuilder I get:

Build failed!

error: Value for SWIFT_VERSION cannot be empty. (in target 'Family_Medical_Diary' from project 'Family_Medical_Diary')

Build ID: b898bc19-02de-4c9f-b72d-1466db23098f<p><br><a class="btn btn-primary" href="https://apps.volt.build/b898bc19-02de-4c9f-b72d-1466db23098f/voltbuilder.log

My config.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<widget 
xmlns = "https://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.nsbasic.{id}"
versionCode = "{phoneGapBuildCounter}"
version = "{version}">

<name>{title}</name>
<description>{description}</description>
<preference name="phonegap-version" value="{phoneGapVersion}" />

<icon src='{icon}' />
<preference name='SplashScreenDelay' value='2000' />
<preference name='AutoHideSplashScreen' value='true' />
<plugin name='cordova-plugin-splashscreen' source='npm' />

<preference name="permissions" value="none"/>

<!-- sample preference specifications -->
<!-- <preference name="autorotate" value="false" readonly="true"/> -->
<!-- <preference name="orientation" value="default" /> -->
<!-- <preference name="fullscreen" value="true" /> -->

<!-- Platforms: Customize as needed. -->
<gap:platforms>
   <gap:platform name="android" />
   <gap:platform name="ios" />
   <preference name="UseSwiftLanguageVersion" value="4.0" />
</gap:platforms>

<plugin name="cordova-plugin-statusbar" source="npm" />
  <preference name="StatusBarOverlaysWebView" value="{phoneGapStatusBarOverlay}" />
  <preference name="StatusBarBackgroundColor" value="{phoneGapStatusBarColor}" />
  <preference name="StatusBarStyle" value="{phoneGapStatusBarStyle}" />

<plugin name="cordova-plugin-whitelist" source="npm" />
  <allow-navigation href="*" />
  <access origin="*" />
  <allow-intent href="*" />

<plugin name="cordova-plugin-fingerprint-aio" source="npm" />**

</widget>

Does VoltBuiler support SWIFT Plugins?

There seems to be lots of discussion around PGB and SWIFT.

I need to use fingerprint authentication, I hope someone can provide a solution.

Thank you,

CONFIG.XML includes:

<!-- Platforms: Customize as needed. -->
<gap:platforms>
   <gap:platform name="android" />
   <gap:platform name="ios" />
   <preference name="UseSwiftLanguageVersion" value="4.0" />
</gap:platforms>

<plugin name="cordova-plugin-fingerprint-aio" source="npm" />

I have added the following to my config.xml:

The error still persists.

I tried adding a SWIFT_VERSION line in he build.json; the error remains…

As I mentioned above, there is lots of discussion regarding PGB having the “hooks” to allow the Swift Version to be specified.

How does VoltBuilder accomodate using a specific version of SWIFT?

Thank you,

It’s not up to VoltBuilder. We pass the config.xml and your assets on to Cordova. The messages you are seeing come from Cordova.

Have a look at the log. Someplace in the middle, it lists all the plugins and versions. You might check if everything is there.

Also, have a look at the issues in https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio/issues to see if there is anything similar.

If not, you may want to open an issue there. The author of the control is well known in the Cordova community. We’ll be happy to work with him to help find a resolution.

Is there any update on this? We also build successfully and deployed with adobe phonegap with this plug in, and now it failed on Voltbuilder.

Are you doing this?

Sorry for the late reply. We use the same configuration that you have, but got the same error: Value for SWIFT_VERSION cannot be empty.

Were you able to get it to work?

<dependency id="cordova-plugin-add-swift-support" version="2.0.2"/>
<gap:platforms>
<gap:platform name="android"/>
<gap:platform name="ios"/>
<gap:platform name="winphone"/>
<preference name="UseLegacySwiftLanguageVersion" value="true"/>
<preference name="UseSwiftLanguageVersion" value="4.0"/>
<preference name="phonegap-version" value="cli-7.1.0"/>
</gap:platforms>
 <plugin name="cordova-plugin-fingerprint-aio" source="npm" spec="1.7.0" />

Same issue here: “UserError: error: Value for SWIFT_VERSION cannot be empty. (in target 'MyAppName' from project 'MyAppName')
(My issue is triggered by a different plugin, but looks like the same underlying issue.)

After some googling, it seems this is fixed by providing cordova/xcode with a “build flag”.

I don’t see a way to specify this in config.xml, but looks like you can with a build.json in the project root. Unfortunately, I tried adding this build.json to my root…
{ "ios": { "debug": { "buildFlag": ["SWIFT_VERSION = 4.0", "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES"] }, "release": { "buildFlag": ["SWIFT_VERSION = 4.0", "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES"] } } }

…but I get the same error. Are build.json files like this in the project root supported (by Voltbuilder) in theory? Thanks!

We’re looking at this.

There’s an error in the documentation for that plugin. It says:

  • Please set <preference name="UseSwiftLanguageVersion" value="4.0" /> in your config.xml

It should read:

  • Please set <preference name="SwiftVersion" value="4.0" /> in your config.xml

We’ll add some additional information to the error message to help others in the future, as well as let the author of the plugin know.

We confirmed that the new preference SwiftVersion work. Thanks.

Fixed my issue as well. Thanks!