[Swift Support Plugin] Issues with MABS 7.0 (CordovaError: Using "requireCordovaModule")
Question
Forge component by David Sousa
Application Type
Mobile

Dear David,

I am trying to generate iOS build for my application, which is using the Swift Support Plugin, using MABS 7.0. I am facing issues while generating the application. The error log is given below:

[2021-01-25T05:17:34.335Z] [INFO] [Build] Applying plugins in the config.xml file...

[2021-01-25T05:17:34.337Z] [INFO] [Build] Plugin Id: https://github.com/DavidSousa/cordova-plugin-add-swift-support#v1.1

[2021-01-25T05:17:34.338Z] [INFO] [Build] Plugin Action: add

[2021-01-25T05:17:38.447Z] [VERBOSE] [Build] No scripts found for hook "before_plugin_add".

[2021-01-25T05:17:38.447Z] [VERBOSE] [Build] Calling plugman.fetch on plugin "https://github.com/DavidSousa/cordova-plugin-add-swift-support#v1.1"

[2021-01-25T05:17:38.559Z] [ERROR] [Build] Executing script found in plugin cordova-plugin-add-swift-support for hook "after_plugin_add": plugins/cordova-plugin-add-swift-support/src/add-swift-support.js

[2021-01-25T05:17:38.559Z] [ERROR] [Build] CordovaError: Using "requireCordovaModule" to load non-cordova module "xcode" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

[2021-01-25T05:17:38.559Z] [ERROR] [Build]     at Context.requireCordovaModule (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/Context.js:57:15)

[2021-01-25T05:17:38.559Z] [ERROR] [Build]     at module.exports (/private/var/lib/builder03/builds/f3174472-a124-4819-943a-35be6bbaf033/source/plugins/cordova-plugin-add-swift-support/src/add-swift-support.js:27:25)

[2021-01-25T05:17:38.559Z] [ERROR] [Build]     at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:157:32)

[2021-01-25T05:17:38.559Z] [ERROR] [Build]     at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:136:12)

[2021-01-25T05:17:38.559Z] [ERROR] [Build]     at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:108:40

[2021-01-25T05:17:38.559Z] [ERROR] [Build]     at processTicksAndRejections (internal/process/task_queues.js:97:5)

[2021-01-25T05:17:38.559Z] [ERROR] [Build] Using "requireCordovaModule" to load non-cordova module "xcode" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.


I am currently using your latest stable version from the git repository (https://github.com/DavidSousa/cordova-plugin-add-swift-support#v1.1). After looking into the code I suppose the issue is being caused by the below lines:

const xcode = context.requireCordovaModule("xcode");

also please consider another instance as well: 

const glob = context.requireCordovaModule("glob");

I request you to kindly do the needful and update the plugin as required.

With best regards,

Shounak

Champion
Solution

Hi Shounak, 

From now on please use the latest version of the component (Forge version 1.1.0).

It's compatible with both MABS 6.3 and MABS 7.0.

Best regards,

David

Thanks a lot @David Sousa. Will upgrade to the latest version, test it and let you know about the results shortly.

Best regards,

Shounak

Hi @David Sousa ,


Error generating in iOS due to xcode, do you know how to fix this? I generated MABS 6.3 and getting this error.


Champion

Hey Shounak,

Haven't had time to update plugins to the new version of MABS.

If you use MABS 6.3 the app generates, right?

Best regards,

David

Dear David,

Yes, on using MABS 6.3 the app generates perfectly. The issue is caused when we try to generate with MABS 7.

Best regards,

Shounak

Champion

I'll work on a fix for MABS 7.0 and release a new version in the Forge. I'll let you know when it's done!

Champion
Solution

Hi Shounak, 

From now on please use the latest version of the component (Forge version 1.1.0).

It's compatible with both MABS 6.3 and MABS 7.0.

Best regards,

David

Thanks a lot @David Sousa. Will upgrade to the latest version, test it and let you know about the results shortly.

Best regards,

Shounak

Hi @David Sousa ,


Error generating in iOS due to xcode, do you know how to fix this? I generated MABS 6.3 and getting this error.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.