13
Views
4
Comments
[Swift Support Plugin] How to use this plugin so that i can generate app with forge requiring swift 3?
Question
Forge component by David Sousa
0
Published on 25 Jan 2021
Application Type
Mobile
Service Studio Version
11.10.5 (Build 37061)

Hi all, 

I have an app that need to use below forge. 

https://www.outsystems.com/forge/component-overview/5262/background-geolocation-services

But when generating ios app, it said " Error generating application. At least one Cordova plugin used in the build requires Swift but no "Swift Language Version" build setting was defined. Check your plugins configuration. "

 The MABS Version is 6.3, and seems it is using swift 5, but the background-geolocation-services is using swift 3 so this error occur?

When using MABS version 5.2, it successfully generates the ios app, but since 5.2 is deprecated, we still prefer to use the latest MABS version.

So i try using this "swift support plugin", and set below configuration  but doesn't work, i simply add this plugin dependency to my app and set below configuration. Is there any missing so the plugin doesn't work?

{

    "preferences": {

        "ios": [

            {

                "name": "UseSwiftLanguageVersion",

                "value": "3"

            }

        ]

    }


}


Thanks.

Rank: #4076

Dear Horace,

Assuming that you have updated the git hub path of the plugin to the latest one ( refer to: [Swift Support Plugin] [semver] cordova-plugin-add-swift-support getting issue while generating iOS | OutSystems ), can you please try to generate your app with the below configuration:

{

    "preferences": {

        "ios": [{

                "name": "UseSwiftLanguageVersion",

                "value": "5"

            }

        ]

    }

}

Cheers !

Shounak

Rank: #20568

Dear Shounak,

Yes i am using "https://github.com/DavidSousa/cordova-plugin-add-swift-support#v1.1"

Setting UseSwiftLanguageVersion  as 5  the error is still occur using MABS 6.3, below the error log:

[2021-01-21T09:05:21.684Z] [ERROR] [Build] error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'testBackgroundgpsplugin' from project 'testBackgroundgpsplugin')

[2021-01-21T09:05:21.684Z] [ERROR] [Build] ** ARCHIVE FAILED **

[2021-01-21T09:05:21.684Z] [ERROR] [Build] Error: xcodebuild: Command failed with exit code 65

[2021-01-21T09:05:21.685Z] [ERROR] [Build] Build failed with the following error: Error generating application. At least one Cordova plugin used in the build requires Swift but no "Swift Language Version" build setting was defined. Check your plugins configuration.

Thanks for your reply, do i miss anything?

Horace

Rank: #4076

Dear Horace,

I did a bit of research on this plugin and it seems the git repository (https://github.com/pmwisdom/cordova-background-geolocation-services.git ), that is being used in this plugin is very old is is not maintained anymore by the developer. Also Apple has stopped supporting Swift version 3.0. So you will not be able to generate apps having swift 3.0 in the components also apple store will not allow to upload these apps.

The only workaround that I can see is that a similar plugin is available at https://github.com/transistorsoft/cordova-background-geolocation-lt . You can use this and create your own OutSystems Plugin similar to the plugin that you are using now. I would suggest you to go through the documentation of this git repository and that will help you to make a new plugin.

Hope this information helps.

Regards,

Shounak 

Rank: #20568

Dear Shounak,

Thank you very much for your reply. There are other available forge for background gps, but only this one allow regular interval to request gps location on IOS which is the main feature I want. It is unfortunately this forge doesn't available anymore..