Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

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

Closed
Macario opened this issue Dec 19, 2017 · 11 comments
Closed

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

Macario opened this issue Dec 19, 2017 · 11 comments

Comments

@Macario
Copy link

Macario commented Dec 19, 2017

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
Copy link

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
Copy link

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

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

@jfbourne
Copy link

One more here with the same issue

@valentinvoilean
Copy link

valentinvoilean commented Dec 27, 2017

Check this: #110

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

@GitFr33
Copy link

GitFr33 commented Jan 7, 2018

Same issue here.

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

@scchess
Copy link

scchess commented May 1, 2018

Me too.

@pgcan
Copy link

pgcan commented May 2, 2018

i am also getting same issue

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

@allanevargas
Copy link

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;
}

ningning-718 added a commit to PluginCordova/cordova-universal-links-plugin that referenced this issue May 15, 2018
@Aarbel
Copy link

Aarbel commented Jun 30, 2018

Have you found a solution ? Thanks !

@DanielGibbsNZ
Copy link

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

@nordnet-deprecation-bot
Copy link
Contributor

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

@nordnet nordnet locked and limited conversation to collaborators Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests