You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Michael Goffioul (JIRA)" <ji...@apache.org> on 2017/12/07 11:55:00 UTC

[jira] [Updated] (CB-13637) Unable to handle local plugins properly

     [ https://issues.apache.org/jira/browse/CB-13637?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Goffioul updated CB-13637:
----------------------------------
    Component/s: cordova-lib

> Unable to handle local plugins properly
> ---------------------------------------
>
>                 Key: CB-13637
>                 URL: https://issues.apache.org/jira/browse/CB-13637
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-cli, cordova-lib
>            Reporter: Michael Goffioul
>
> 1) create a new cordova project
> 2) inside the project directory, create folder "localplugins/testplugin" containing the file:
> - package.json
> {code}
> {
> 	"name": "com.example.cordova.plugin",
> 	"version": "1.0.0"
> }
> {code}
> - plugin.xml
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="com.example.cordova.plugin" version="1.0.0">
>     <name>Test Plugin</name>
>     <platform name="android">
>         <config-file target="AndroidManifest.xml" parent="/*">
>             <uses-permission android:name="android.permission.WAKE_LOCK" />
>         </config-file>
>     </platform>
> </plugin>
> {code}
> 3) add android patform: cordova platform add android
> 4) prepare android: cordova prepare android
> At this point, both package.json and config.xml contain a reference to the plugin using "file:localplugins/testplugin". The problem is that it's impossible to use the same plugin reference in both files, and still having plugin restoration and/or "npm install" to work.
> If I delete platforms/ and plugins/ subdir (these are typically not under git revision control) and run "cordova prepare android" to restore the platforms and the plugins, it fails with error:
> {code}
> Discovered plugin "com.example.cordova.plugin" in config.xml. Adding it to the project
> Failed to restore plugin "com.example.cordova.plugin" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin file:localplugins/testplugin via registry.
> Probably this is either a connection problem, or plugin spec is incorrect.
> Check your connection and plugin name/version/URL.
> Failed to get absolute path to installed module
> {code}
> If I edit package.json and config.xml, and remove the prefix "file:" in the plugin spec, then restoration works ok. But then, it's "npm install" that fails.
> What works is to use the "file:" prefix in package.json and not use it in "config.xml". But that's not possible as preparation will make sure both are identical.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org