You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 17, 2023. It is now read-only.
I can't do cordova build because of something in the plugin after upgrading to Cordova 7.0.0. See the error below. Once I remove the plugin, I can build successfully.
The commit @peterpeterparker linked to seems to have removed some deprecated stuff. Was there a deprecation notice output when executing this with Cordova 6.5.0?
I've come up with a much simpler solution. Can anyone confirm this works as intended? It appears to work OK for me, but I'm insufficiently familiar with the inner machinations of Cordova to know how good a solution it is.
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;
}
janpio, ben-8409, AndreiTelteu, gregor-srdic, s-pic and 1 more
Activity
ihadeed commentedon May 6, 2017
@cindyliu-yb
I don't think this is related to this plugin. I was just experiencing the same issue. Run the following command to fix it:peterpeterparker commentedon May 6, 2017
@ihadeed it's related to this plugin I think...
=> Error: Cannot find module '../plugman/platforms/ios'
=> ok but fail later on ionic build ios --prod
=> ok
P.S.: I didn't faced that error with the android platform, was alright
peterpeterparker commentedon May 6, 2017
In xcodePreferences.js:
But 'cordova-lib/src/plugman/platforms/ios' seems to doesn't exist anymore in Cordova 7.0.0, see following commit:
apache/cordova-lib@64fea70
janpio commentedon May 6, 2017
So this https://github.com/driftyco/ionic-plugin-deeplinks/blob/master/hooks/afterPrepareHook.js
is including this https://github.com/driftyco/ionic-plugin-deeplinks/blob/master/hooks/lib/ios/xcodePreferences.js where these lines don't do what they are supposed to do any more: https://github.com/driftyco/ionic-plugin-deeplinks/blob/master/hooks/lib/ios/xcodePreferences.js#L151-L159
The commit @peterpeterparker linked to seems to have removed some deprecated stuff. Was there a deprecation notice output when executing this with Cordova 6.5.0?
peterpeterparker commentedon May 6, 2017
He you go, a quick and dirty solution. In xcodePreferences.js, replace method loadProjectFile with following code:
ihadeed commentedon May 8, 2017
@peterpeterparker thanks for the fix. You should submit a PR :)
peterpeterparker commentedon May 8, 2017
@ihadeed sure, would be my pleasure: #103
Merge pull request #103 from peterpeterparker/fix-cordova7
aramando commentedon May 17, 2017
I've come up with a much simpler solution. Can anyone confirm this works as intended? It appears to work OK for me, but I'm insufficiently familiar with the inner machinations of Cordova to know how good a solution it is.
ihadeed commentedon May 17, 2017
@peterpeterparker 's PR was merged, this should be fixed now.
peterpeterparker commentedon May 17, 2017
@ihadeed yes it's merged and confirm it's fixed but of course Im not against a easier cuter solution, like I said, I did a quick fix
mlynch commentedon Sep 19, 2017
btw I removed all the hooks. Caused more problems than they were worth. See #82
fix for issue related to cordova 7.0
Prodev2017 commentedon Dec 16, 2017
I tried to add ionic-plugin-deeplink
but i got errors
An error occurred while running cordova plugin add ionic-plugin-deeplink --save (exit
Please help me
timothylombrana commentedon Jan 13, 2018
Any update on installation error, I as well am getting a 404. Could really use the help.
ionic-team#99: Fix Xcode project file detection for Cordova 7