nordnet/cordova-universal-links-plugin

Error: Cannot find module '../plugman/platforms/ios' - Cordova 7.1.0

Macario opened this issue ยท 11 comments

Hi. I'm trying to use universal links plugin on iOS but when I install it, I can't add iOS platform and a get the error: Error: Cannot find module '../plugman/platforms/ios'

Cordova version: 7.1.0
cordova-ios version: 4.5.4
cordorva-universal-links-plugin version: 1.2.1
xCode 9

I got same message, Cannot find module '../plugman/platforms/ios'

Cordova version: 8.0.0
cordova-ios version: 4.5.4
cordorva-universal-links-plugin version: 1.2.1
xCode 9

I'm having the same issue? Anyone can solved it?

Cordova version: 7.1.0
cordorva-universal-links-plugin version: 1.2.1

One more here with the same issue

Check this: #110

I used the fork from this comment: #110 (comment)

Same issue here.

cordova-universal-links-plugin version 1.2.1
cordova v8.0.0
ios v4.5.4

Me too.

pgcan commented

i am also getting same issue

cordova-universal-links-plugin version 1.2.1
cordova v8.0.0
ios v4.2.0

In <project_folder>\plugins\cordova-universal-links-plugin\hooks\lib\ios\xcodePreferences.js

Change line 135-150:

function loadProjectFile() {
  var platform_ios;
  var projectFile;

  try {
    // try pre-5.0 cordova structure
    platform_ios = context.requireCordovaModule('cordova-lib/src/plugman/platforms')['ios'];
    projectFile = platform_ios.parseProjectFile(iosPlatformPath());
  } catch (e) {
    // let's try cordova 5.0 structure
    platform_ios = context.requireCordovaModule('cordova-lib/src/plugman/platforms/ios');
    projectFile = platform_ios.parseProjectFile(iosPlatformPath());
  }

  return projectFile;
}

To this:

function loadProjectFile() {
  var platform_ios;
  var projectFile;
  try {
    // try pre-5.0 cordova structure
    platform_ios = context.requireCordovaModule('cordova-lib/src/plugman/platforms')['ios'];
    projectFile = platform_ios.parseProjectFile(iosPlatformPath());
  } catch (e) {
    try {
      // let's try cordova 5.0 structure
      platform_ios = context.requireCordovaModule('cordova-lib/src/plugman/platforms/ios');
      projectFile = platform_ios.parse(iosPlatformPath());
    } catch (e) {
      // try cordova 7.0 structure
      var iosPlatformApi = require(path.join(iosPlatformPath(), '/cordova/Api'));
      var projectFileApi = require(path.join(iosPlatformPath(), '/cordova/lib/projectFile.js'));
      var locations = (new iosPlatformApi()).locations;
      projectFile = projectFileApi.parse(locations);
    }
  }
  return projectFile;
}

Have you found a solution ? Thanks !

@Aarbel The solution that @aecvargas posted above worked for me.

๐Ÿ‘‹ Hi! Thank you for your interest in this repo.

๐Ÿ˜ข We are not using nordnet/cordova-universal-links-plugin anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.

๐Ÿ”’ This will now be closed & locked.

โ„น๏ธ Please see #160 for more information.