Phonegap add plugin fails (errno 34) */plugin.xml

不想你离开。 提交于 2019-12-23 12:08:13

问题


When I add a plugin to a 3.0.0 phonegap project with an android platform, I have an error eventhough a bunch of files for the plugin are added. In addition to that error when I add it, the Android manifest never gets updated with the right authorizations.

$ cordova plugin ls

No plugins added. 'Use cordova plugin add <plugin>'.

$ sudo cordova plugin add "http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git"

{ [Error: ENOENT, no such file or directory '/tmp/plugman-tmp1375200648427/*/plugin.xml']

  errno: 34,

  code: 'ENOENT',

  path: '/tmp/plugman-tmp1375200648427/*/plugin.xml',

  syscall: 'open' }

$ cordova plugin ls

[ 'org.apache.cordova.core.media-capture' ]

回答1:


I was having the same problem with the Connection plugin. Once I changed from "cordova plugin add" to "phonegap local plugin add", it worked fine.

$ phonegap local plugin add http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git



回答2:


I had the same problem, after some debugging and testing I finally solved the problem:

  1. Open C:\Users\<user>\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\util\plugins.js.

  2. Find var cmd = util.format('git clone "%s" "%s"', plugin_git_url, path.basename(tmp_dir)); (line 42 ATM)

  3. Replace it with var cmd = util.format('git clone "%s" "%s"', plugin_git_url, tmp_dir);.

This will make git clone clone to the absolute tmp path instead of the relative.




回答3:


I received a similar error. I resolved the issue by removing the media-capture plugin, installing the file plugin, then reinstalling the media-capture plugin

cordova plugin rm  org.apache.cordova.media-capture
cordova plugin add org.apache.cordova.file
cordova plugin add org.apache.cordova.media-capture

Maybe media-capture is dependent on the file plugin.




回答4:


I was also facing the same error :

Suppose if you want to add camera plugin then instead of giving:

cordova plugin add cordova-plugin-camera

use

phonegap plugin add cordova-plugin-camera

and then it will work fine




回答5:


It turns out i had something really strange with my proxy. Possibly some data compression on the fly which made the data corrupt. Tethering from the phone solved the issue, after completely uninstalling cordova.



来源:https://stackoverflow.com/questions/17952332/phonegap-add-plugin-fails-errno-34-plugin-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!