我正在尝试添加此插件https://github.com/MobileAppTracking/phonegap-plugin但是当我运行该命令时,我看到了这个错误:
Error during processing of action! Attempting to revert...
Failed to install 'com.mobileapptracking.matplugin':TypeError: Uh oh!
Arguments to path.resolve must be strings
at Object.exports.resolve (path.js:313:15)
at module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:106:31)
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:70:25)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:567:20)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:322:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
TypeError: Uh oh!
Arguments to path.resolve must be strings
at Object.exports.resolve (path.js:313:15)
at module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/android.js:106:31)
at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:70:25)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:567:20)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:322:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
我的节点版本是v0.10.25
我的npm版本是1.3.10
我的cordova版本是3.6.3-0.2.13
答案 0 :(得分:9)
你应该更新你的Cordova版本和cordova-android,删除插件并清理它已安装的依赖项,然后再安装一个新的插件
更新Cordova:
sudo npm update -g cordova
更新android平台
cordova platform update android
在您的情况下,您似乎应该删除插件
cordova plugin remove com.mobileapptracking.matplugin
在目录中手动删除Play服务依赖项
在android.json
档案
然后重新安装插件
cordova plugin add https://github.com/MobileAppTracking/phonegap-plugin
答案 1 :(得分:0)
您应该更新您的Cordova版本并更新您的Android平台或完全删除它,然后再次添加。
请更新Cordova:
sudo npm update -g cordova
请使用以下命令删除您的Android平台
cordova platform rm android
然后使用以下命令添加平台
cordova platform add android
希望这会对你有帮助!