Cordova build returns missing plugin.xml
Asked Answered
A

6

16

When i build my cordova project i get an warning message as:

Missing file: /home/vijay/workspace/Repos_temp/QuickTraq_Android/plugins/nl.x-services.plugins.toast/plugin.xml

Missing file: /home/vijay/workspace/Repos_temp/QuickTraq_Android/plugins/cordova-plugin-device-rotation-vector/plugin.xml

This happens when i add an plugin or remove an plugin also .

This happens just as a warning when i add a plugin or build the project but when i remove the plugin error occurs as

Error: ENOENT, no such file or directory '/home/vijay/workspace/Repos_temp/QuickTraq_Android/plugins/com.grumpysailor.cordova-plugin-device-rotation-vector/plugin.xml' at Object.fs.openSync (fs.js:439:18) at Object.fs.readFileSync (fs.js:290:15) at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/util/xml-helpers.js:121:27) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/dependencies.js:56:35 at Array.forEach (native) at Object.module.exports.package.generateDependencyInfo (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/dependencies.js:53:45) at runUninstallPlatform (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/uninstall.js:218:53) at Function.module.exports.uninstallPlatform (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/uninstall.js:81:12) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/plugin.js:205:58 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)

and my plugin remove failed .. Is there an way to resolve this ??

Amylolysis answered 14/5, 2015 at 8:25 Comment(4)
Could you try to add the plugin again (use phonegap local plugin add) if in-case you used Cordova's commands. If that still won't work, try cleaning npm's cache with npm cache clean and re-install Cordova/Phonegap.Zusman
I tried npm cache clean . I don't want to reinstall cordova is there an work around ??Amylolysis
May I ask why are you unwilling to re-install Cordova? And what happens when you try to add the plugin again?Zusman
I have an working environment and i fear something might happen . So i font prefer to reinstall . When i add the plugin it says already exists.Amylolysis
Z
20

The plugin.xml looks to be missing. The path to each added plugin's plugin.xml should be:

 <yourapp>/plugins/<some-plugin>/plugin.xml

If you cannot find the plugin.xml files in those folders, you will have to manually download it from its git resource. Try adding device-rotation-vector's xml from here and then run:

cordova plugin remove cordova-plugin-device-rotation-vector

If it works correctly, do the same for Toast plugin.

You can find the list of plugins installed using:

cordova plugin list
Zusman answered 18/5, 2015 at 9:38 Comment(4)
Exactly did the same and worked !! I think there could be an error while removing the plugin last time . Thanks :)Amylolysis
Glad to know. And yeah, it could be while you tried to remove it the last time; that is why you should be careful about every error given by the CLI while adding/removing anything.Zusman
This error could be caused by something else entirely.Italic
In case this helps, while using Cordova with Ionic, I have noticed that when I'm switching between machines using the same repo after adding a cordova plugin on one machine but not the other, I see the error above; and the solution for me has been to ionic platform rm android ios and ionic platform add android ios.Individuate
I
11

Remove folder "plugin_name" in rootApp_folder/plugins/plugin_name and try to add again.

Incantation answered 18/2, 2017 at 15:23 Comment(0)
S
3

SOLVED

Please try to add the plugin from GitHub repository. I had to install app-preferences plugin. So, I just did it like:

$ cordova plugin add https://github.com/apla/me.apla.cordova.app-preferences

Saccharide answered 21/12, 2017 at 5:27 Comment(0)
M
2

These solutions not worked for me. I just restarted the command prompt, then everything working fine

Maxon answered 27/2, 2018 at 9:14 Comment(0)
A
0

Close all Windows that may touch upon the install. Then try to install again.

W10:... I had an open Command Prompt open to an Android build output folder. The install was unable to delete a file, which failed the install, until after I closed the Command Prompt window.

Agapanthus answered 1/4, 2017 at 22:13 Comment(0)
D
0

Removing the plugin folder worked for me, otherwise, both remove and add plugin was giving the same error.

Another method was to remove and re-add platform, but sometimes you have to install the plugins manually before adding the platform.

Dowry answered 6/10, 2021 at 12:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.