nordnet / cordova-universal-links-plugin

[DEPRECATED] - Cordova plugin to support Universal/Deep Links for iOS/Android.
https://github.com/nordnet/cordova-universal-links-plugin/issues/160
MIT License
349 stars 526 forks source link

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

Closed Macario closed 5 years ago

Macario commented 6 years ago

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

hsunny110 commented 6 years ago

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

maxigarciaf commented 6 years ago

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

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

jfbourne commented 6 years ago

One more here with the same issue

valentinvoilean commented 6 years ago

Check this: https://github.com/nordnet/cordova-universal-links-plugin/issues/110

I used the fork from this comment: https://github.com/nordnet/cordova-universal-links-plugin/issues/110#issuecomment-341081738

GitFr33 commented 6 years ago

Same issue here.

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

scchess commented 6 years ago

Me too.

pgcan commented 6 years ago

i am also getting same issue

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

allanevargas commented 6 years ago

In \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;
}
Aarbel commented 6 years ago

Have you found a solution ? Thanks !

DanielGibbsNZ commented 6 years ago

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

nordnet-deprecation-bot commented 5 years ago

👋 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.