[ https://issues.apache.org/jira/browse/CB-13801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16386996#comment-16386996 ]
Jacob Weber edited comment on CB-13801 at 3/6/18 12:11 AM: ----------------------------------------------------------- I'm running into this myself. A few notes: * It affects iOS too, not just Android. * Running it on Cordova 8.0.0 and 7.0.1, I'm seeing the same error, but when I open the npm debug log, it shows different values for the "cwd" line; on 7.0.1 it seems to be running from within node_modules. * If I change the paths in both config.xml and package.json to {{../myplugins/testplugin}}, this fixes the error on 7.0.1 (but not 8.0.0). I reproduced this by doing: {code:java} cordova create CordovaTest com.sample.cordovatest CordovaTest cd CordovaTest cordova platform add ios@4.5.4 cordova plugin add cordova-plugin-whitelist # copy local plugin into CordovaTest cordova plugin add myplugins/testplugin rm -rf node_modules/ plugins/ platforms/ cordova prepare{code} was (Author: jweber): I'm running into this myself. A few notes: * It affects iOS too, not just Android. * Running it from Mac OS X and CentOS 6, I'm seeing the same error, but when I open the npm debug log, it shows different values for the "cwd" line; on CentOS it seems to be running from within node_modules. * If I change the paths in both config.xml and package.json to {{../myplugins/testplugin}}, this fixes the error on CentOS (but not Mac OS). * HOWEVER, even on CentOS, it only works if I delete the package-lock.json file before running {{cordova prepare}}. If I leave it, I get a very bizarre error, where it seems to be confusing a plugin for a platform: {code:java} Discovered platform "ios@^4.5.4" in config.xml or package.json. Adding it to the project Using cordova-fetch for cordova-ios@^4.5.4 Adding cordova-plugin-whitelist project... Error: Your cordova-plugin-whitelist platform does not have Api.js Error: No platforms added to this project. Please use `cordova platform add <platform>`. {code} I reproduced this by doing: {code:java} cordova create CordovaTest com.sample.cordovatest CordovaTest cd CordovaTest cordova platform add ios@4.5.4 cordova plugin add cordova-plugin-whitelist # copy local plugin into CordovaTest cordova plugin add myplugins/testplugin rm -rf node_modules/ plugins/ platforms/ cordova prepare{code} > Fail to restore plugins with relative path > ------------------------------------------ > > Key: CB-13801 > URL: https://issues.apache.org/jira/browse/CB-13801 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-lib > Reporter: Michael Goffioul > Priority: Major > > 1. Create a cordova project > 2. Add android platform > 3. Add a local plugin using a relative path: {{cordova plugin add > myplugins/testplugin}} > 4. Delete directories platforms/ and plugins/ > 5. Prepare android: {{cordova prepare android}} > Cordova will fail to restore the local plugin. The plugin has been added to > {{package.json}} using the spec {{file:myplugins/testplugin}} and the > restoration utility is unable to handle such URL. Note that {{config.xml}} > contains the spec {{myplugins/testplugin}} (that is, without the file: > scheme), but the one in {{package.json}} takes precedence. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org