akofman / cordova-plugin-add-swift-support

:hammer: Swiftify your Cordova app !
MIT License
117 stars 110 forks source link

Still having problem with requireCordovaModule #69

Open JPAlfa opened 5 years ago

JPAlfa commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

I'm using: