cordova-plugin-add-swift-support icon indicating copy to clipboard operation
cordova-plugin-add-swift-support copied to clipboard

Still having problem with requireCordovaModule

Open JPAlfa opened this issue 5 years ago • 2 comments

I'm still having problem with the requireCordovaModule. I was having problems with cordova prepare ios, because of the lines 172, 174 and 192 on the file src/add-swift-support.js.

It's caused by the context.requireCordovaModule. I changed to just require, and it worked. Am I missing something or this is still causing error? I can make a PR if necessary.

JPAlfa avatar Nov 22 '19 15:11 JPAlfa

The bold parts are the errors:

if (semver.lt(context.opts.cordova.version, '5.4.0')) { ConfigParser = context.requireCordovaModule('cordova-lib/src/ConfigParser/ConfigParser'); } else { ConfigParser = context.requireCordovaModule('cordova-common/src/ConfigParser/ConfigParser'); }

return new ConfigParser(configPath); };

const getBridgingHeaderPath = (projectPath, iosPlatformVersion) => { let bridgingHeaderPath; if (semver.lt(iosPlatformVersion, '4.0.0')) { bridgingHeaderPath = path.posix.join(projectPath, 'Plugins', 'Bridging-Header.h'); } else { bridgingHeaderPath = path.posix.join(projectPath, 'Bridging-Header.h'); }

return bridgingHeaderPath; };

const getPlatformVersionsFromFileSystem = (context, projectRoot) => { const cordovaUtil = context.requireCordovaModule('cordova-lib/src/cordova/util');

JPAlfa avatar Nov 22 '19 15:11 JPAlfa

I'm using:

  • [x] cordova 9
  • [x] cordova-ios 5.0.1
  • [x] cordova-android 8.1.0
  • [x] cordova-plugin-add-swift-support 2.0.2

JPAlfa avatar Nov 22 '19 16:11 JPAlfa