Closed pedoc closed 5 years ago
碰到同样问题 cordova android@7.1.2
同样的问题 Error during processing of action! Attempting to revert... Failed to install 'jpush-phonegap-plugin': TypeError: Uh oh! Path must be a string. Received undefined
提供更多的信息
Dependencies detected, iterating through them...
Requesting plugin "cordova-plugin-device".
Plugin dependency "cordova-plugin-device@2.0.2" already fetched, using that version.
Dependent plugin "cordova-plugin-device" already installed on android.
Requesting plugin "cordova-plugin-jcore".
Plugin dependency "cordova-plugin-jcore@1.2.5" already fetched, using that version.
Dependent plugin "cordova-plugin-jcore" already installed on android.
Finding scripts for "before_plugin_install" hook from plugin jpush-phonegap-plugin on android platform only.
No scripts found for hook "before_plugin_install".
Install start for "jpush-phonegap-plugin" on android.
Beginning processing of action stack for android project...
Error during processing of action! Attempting to revert...
Failed to install 'jpush-phonegap-plugin': TypeError: Uh oh!
Path must be a string. Received undefined
at assertPath (path.js:28:11)
at Object.resolve (path.js:1186:7)
at copyNewFile (/Users/jianyxu/Documents/AptanaWokspace/job910video2/platforms/android/cordova/lib/pluginHandlers.js:258:28)
at install (/Users/jianyxu/Documents/AptanaWokspace/job910video2/platforms/android/cordova/lib/pluginHandlers.js:43:17)
at ActionStack.process (/Users/jianyxu/Documents/AptanaWokspace/job910video2/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
at PluginManager.doOperation (/Users/jianyxu/Documents/AptanaWokspace/job910video2/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
at PluginManager.addPlugin (/Users/jianyxu/Documents/AptanaWokspace/job910video2/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:144:17)
at /Users/jianyxu/Documents/AptanaWokspace/job910video2/platforms/android/cordova/Api.js:247:74
at _fulfilled (/Users/jianyxu/Documents/AptanaWokspace/job910video2/platforms/android/cordova/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/Users/jianyxu/Documents/AptanaWokspace/job910video2/platforms/android/cordova/node_modules/q/q.js:863:30)
Uh oh!
Path must be a string. Received undefined
建议先强制版本为7.1.1,这个是正常的
我的cordova platform add androd@7.1.1 。 但是还是会报错?如何解决? Failed to install 'cordova-plugin-jcore': Error: ENOENT: no such file or directory, open 'E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\AndroidManifest.xml' at Object.fs.openSync (fs.js:646:18) at Object.fs.readFileSync (fs.js:551:33) at Object.parseElementtreeSync (E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\cordova\node_modules\cordova-common\src\util\xml-helpers.js:180:27) at new AndroidManifest (E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\cordova\lib\AndroidManifest.js:29:20) at AndroidProject.getPackageName (E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\cordova\lib\AndroidProject.js:99:12) at Api.addPlugin (E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\cordova\Api.js:223:57) at handleInstall (D:\node\node_global\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:594:10) at D:\node\node_global\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:357:28 at _fulfilled (D:\node\node_global\node_modules\cordova\node_modules\q\q.js:854:54) at self.promiseDispatch.done (D:\node\node_global\node_modules\cordova\node_modules\q\q.js:883:30) Failed to install 'jpush-phonegap-plugin': Error: ENOENT: no such file or directory, open 'E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\AndroidManifest.xml' at Object.fs.openSync (fs.js:646:18) at Object.fs.readFileSync (fs.js:551:33) at Object.parseElementtreeSync (E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\cordova\node_modules\cordova-common\src\util\xml-helpers.js:180:27) at new AndroidManifest (E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\cordova\lib\AndroidManifest.js:29:20) at AndroidProject.getPackageName (E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\cordova\lib\AndroidProject.js:99:12) at Api.addPlugin (E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\cordova\Api.js:223:57) at handleInstall (D:\node\node_global\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:594:10) at D:\node\node_global\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:357:28 at _fulfilled (D:\node\node_global\node_modules\cordova\node_modules\q\q.js:854:54) at self.promiseDispatch.done (D:\node\node_global\node_modules\cordova\node_modules\q\q.js:883:30) Failed to restore plugin "jpush-phonegap-plugin" from config.xml. You might need to try adding it again. Error: Error: ENOENT: no such file or directory, open 'E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\AndroidManifesuch file or directory, open 'E:\workspace.lvya\tempus_sys\ETB\SDETB\TMS-OEM-SDTP-ETB\ETB\APP\sdtp\platforms\android\AndroidManifest.xml'
WARNING: 如果不按照这个表格,我们将无法帮助你,并将忽略你的问题。
你的运行环境
cordova -v
): 8.1.2 (cordova-lib@8.1.1)cordova platform ls
): 7.1.2期望效果
cordova platform add android 命令成功执行,成功创建android工程
实际效果
报错,日志如下(我插件有点儿多,错误信息在最后) Using cordova-fetch for cordova-android@7.1.2 Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: net.jcreator.ljxqnews Name: ljxqnews Activity: MainActivity Android target: android-27 Android project created with cordova-android@7.1.2 Android Studio project detected Android Studio project detected Installing "cordova-plugin-app-version" for android Installing "cordova-plugin-backbutton" for android Installing "cordova-plugin-crosswalk-webview" for android Subproject Path: CordovaLib Subproject Path: app
Installing "cordova-plugin-device" for android Installing "cordova-plugin-fullscreen" for android Installing "cordova-plugin-inappbrowser" for android Installing "cordova-plugin-jcore" for android Installing "cordova-plugin-qqsdk" for android Subproject Path: CordovaLib Subproject Path: app Installing "cordova-plugin-splashscreen" for android Installing "cordova-plugin-statusbar" for android Installing "cordova-plugin-themeablebrowser" for android Installing "cordova-plugin-wechat" for android Subproject Path: CordovaLib Subproject Path: app Running android-install.Hook: after_plugin_install, Package: net.jcreator.ljxqnews, Path: J:\CordovaProjects\ljxqnews. Installing "cordova-plugin-weibosdk" for android Subproject Path: CordovaLib Subproject Path: app Installing "cordova-plugin-whitelist" for android
Installing "jpush-phonegap-plugin" for android Plugin dependency "cordova-plugin-device@2.0.2" already fetched, using that version. Dependent plugin "cordova-plugin-device" already installed on android. Plugin dependency "cordova-plugin-jcore@1.2.5" already fetched, using that version. Dependent plugin "cordova-plugin-jcore" already installed on android. Error during processing of action! Attempting to revert... Failed to install 'jpush-phonegap-plugin': TypeError: Uh oh! Path must be a string. Received undefined at assertPath (path.js:28:11) at Object.resolve (path.js:211:7) at copyNewFile (J:\CordovaProjects\ljxqnews\platforms\android\cordova\lib\pluginHandlers.js:258:28) at install (J:\CordovaProjects\ljxqnews\platforms\android\cordova\lib\pluginHandlers.js:43:17) at ActionStack.process (J:\CordovaProjects\ljxqnews\platforms\android\cordova\node_modules\cordova-common\src\ActionStack.js:56:25) at PluginManager.doOperation (J:\CordovaProjects\ljxqnews\platforms\android\cordova\node_modules\cordova-common\src\PluginManager.js:114:20) at PluginManager.addPlugin (J:\CordovaProjects\ljxqnews\platforms\android\cordova\node_modules\cordova-common\src\PluginManager.js:144:17) at J:\CordovaProjects\ljxqnews\platforms\android\cordova\Api.js:247:74 at _fulfilled (J:\CordovaProjects\ljxqnews\platforms\android\cordova\node_modules\q\q.js:834:54) at self.promiseDispatch.done (J:\CordovaProjects\ljxqnews\platforms\android\cordova\node_modules\q\q.js:863:30) Uh oh! Path must be a string. Received undefined
重现步骤
背景
cordova platform add androd@7.1.1 是可以成功的