jpush / jpush-phonegap-plugin

JPush's officially supported PhoneGap/Cordova plugin (Android & iOS). 极光推送官方支持的 PhoneGap/Cordova 插件(Android & iOS)。
https://docs.jiguang.cn
MIT License
925 stars 350 forks source link

cordova android@7.1.2 创建报错 #379

Closed pedoc closed 5 years ago

pedoc commented 5 years ago

WARNING: 如果不按照这个表格,我们将无法帮助你,并将忽略你的问题。

你的运行环境

期望效果

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

    After much discussion and analysis of the market, we have decided to discontinue support for Android 4.0 (ICS) in Crosswalk starting with version 20.

    So the minSdkVersion of Cordova project is configured to 16 by default.

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

           This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

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

重现步骤

  1. cordova create myapp com.myapp myapp
  2. cordova plugin add jpush
  3. cordova platform add androd 或cordova platform add androd@7.1.2

背景

cordova platform add androd@7.1.1 是可以成功的

cnwyx commented 5 years ago

碰到同样问题 cordova android@7.1.2

xjy0925 commented 5 years ago

同样的问题 Error during processing of action! Attempting to revert... Failed to install 'jpush-phonegap-plugin': TypeError: Uh oh! Path must be a string. Received undefined

xjy0925 commented 5 years ago

提供更多的信息

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
pedoc commented 5 years ago

建议先强制版本为7.1.1,这个是正常的

JoshLipan commented 5 years ago

升级至v3.5.0

Fengmaybe commented 5 years ago

我的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'