{"action":"created","issue":{"url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/131","repository_url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin","labels_url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/131/comments","events_url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/131/events","html_url":"https://github.com/nordnet/cordova-universal-links-plugin/issues/131","id":283334907,"number":131,"title":"Error: Cannot find module '../plugman/platforms/ios' - Cordova 7.1.0","user":{"login":"Macario","id":1316661,"avatar_url":"https://avatars3.githubusercontent.com/u/1316661?v=4","gravatar_id":"","url":"https://api.github.com/users/Macario","html_url":"https://github.com/Macario","followers_url":"https://api.github.com/users/Macario/followers","following_url":"https://api.github.com/users/Macario/following{/other_user}","gists_url":"https://api.github.com/users/Macario/gists{/gist_id}","starred_url":"https://api.github.com/users/Macario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Macario/subscriptions","organizations_url":"https://api.github.com/users/Macario/orgs","repos_url":"https://api.github.com/users/Macario/repos","events_url":"https://api.github.com/users/Macario/events{/privacy}","received_events_url":"https://api.github.com/users/Macario/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-12-19T18:58:31Z","updated_at":"2018-05-09T14:40:27Z","closed_at":null,"author_association":"NONE","body":"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'\r\n\r\nCordova version: 7.1.0\r\ncordova-ios version: 4.5.4\r\ncordorva-universal-links-plugin version: 1.2.1\r\nxCode 9"},"comment":{"url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/comments/387761895","html_url":"https://github.com/nordnet/cordova-universal-links-plugin/issues/131#issuecomment-387761895","issue_url":"https://api.github.com/repos/nordnet/cordova-universal-links-plugin/issues/131","id":387761895,"user":{"login":"aecvargas","id":29106807,"avatar_url":"https://avatars0.githubusercontent.com/u/29106807?v=4","gravatar_id":"","url":"https://api.github.com/users/aecvargas","html_url":"https://github.com/aecvargas","followers_url":"https://api.github.com/users/aecvargas/followers","following_url":"https://api.github.com/users/aecvargas/following{/other_user}","gists_url":"https://api.github.com/users/aecvargas/gists{/gist_id}","starred_url":"https://api.github.com/users/aecvargas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aecvargas/subscriptions","organizations_url":"https://api.github.com/users/aecvargas/orgs","repos_url":"https://api.github.com/users/aecvargas/repos","events_url":"https://api.github.com/users/aecvargas/events{/privacy}","received_events_url":"https://api.github.com/users/aecvargas/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T14:40:27Z","updated_at":"2018-05-09T14:40:27Z","author_association":"NONE","body":"In <project_folder>\\plugins\\cordova-universal-links-plugin\\hooks\\lib\\ios\\xcodePreferences.js\r\n\r\nChange line 135-150:\r\n```\r\nfunction loadProjectFile() {\r\n  var platform_ios;\r\n  var projectFile;\r\n\r\n  try {\r\n    // try pre-5.0 cordova structure\r\n    platform_ios = context.requireCordovaModule('cordova-lib/src/plugman/platforms')['ios'];\r\n    projectFile = platform_ios.parseProjectFile(iosPlatformPath());\r\n  } catch (e) {\r\n    // let's try cordova 5.0 structure\r\n    platform_ios = context.requireCordovaModule('cordova-lib/src/plugman/platforms/ios');\r\n    projectFile = platform_ios.parseProjectFile(iosPlatformPath());\r\n  }\r\n\r\n  return projectFile;\r\n}\r\n```\r\nTo this:\r\n```\r\nfunction loadProjectFile() {\r\n  var platform_ios;\r\n  var projectFile;\r\n  try {\r\n    // try pre-5.0 cordova structure\r\n    platform_ios = context.requireCordovaModule('cordova-lib/src/plugman/platforms')['ios'];\r\n    projectFile = platform_ios.parseProjectFile(iosPlatformPath());\r\n  } catch (e) {\r\n    try {\r\n      // let's try cordova 5.0 structure\r\n      platform_ios = context.requireCordovaModule('cordova-lib/src/plugman/platforms/ios');\r\n      projectFile = platform_ios.parse(iosPlatformPath());\r\n    } catch (e) {\r\n      // try cordova 7.0 structure\r\n      var iosPlatformApi = require(path.join(iosPlatformPath(), '/cordova/Api'));\r\n      var projectFileApi = require(path.join(iosPlatformPath(), '/cordova/lib/projectFile.js'));\r\n      var locations = (new iosPlatformApi()).locations;\r\n      projectFile = projectFileApi.parse(locations);\r\n    }\r\n  }\r\n  return projectFile;\r\n}\r\n```"}}
{"actor":{"display_login":"aecvargas"}}