今天自定义了一个插件,在cordova项目添加插件时,出现了如下错误:
~/Desktop/Cordova/MyCordovaCamera$ cordova plugin add /home/kyun/Desktop/Cordova/CSCamera
{ CordovaError: Could not determine package name from output:
at getTargetPackageSpecFromNpmInstallOutput (/usr/local/lib/node_modules/cordova/node_modules/cordova-fetch/index.js:104:11)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
name: 'CordovaError',
message: 'Could not determine package name from output:\n',
code: 0,
context: undefined }
出现错误的原因是plugin.xml配置java实现类时出错:
<source-file src="src/android/CSCamera.java" target-dir="src/com/cs/camera/CSCamera" />
<source-file src="src/android/CSCamera.java" target-dir="src/com/cs/camera" />