Cordova platform version (cordova platform ls): android 6.3.0
Ionic Version (if using Ionic): 3.20.0
期望效果
在ionic1中使用jpush,调取api成功
实际效果
无任何反应发生,在java处用toast打印,没有任何反应,我猜想是没有调用成功java代码.
重现步骤
`$ionicPlatform.ready(function () {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
document.addEventListener("jpush.openNotification", function (event) {
var alertContent
if (ionic.Platform.isAndroid()) {
alertContent = event.alert
} else {
alertContent = event.aps.alert
}
alert(alertContent)
}, false);
});`
背景
我重新安装了一遍jcore与jpush-phonegap-plugin,并且js部分的代码调用成功,但是callback并不会发生,java部分的代码无任何反应
android studio 运行产生如下问题
Caused by: java.lang.ClassNotFoundException: Didn't find class "cn.jiguang.cordova.push.JPushPlugin" on path: DexPathList[[zip file "/data/app/com.quangao.pnlyjz-1/base.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.quangao.pnlyjz-1/lib/x86, /system/lib, /vendor/lib]]
我找到了一个原因是 android 7.0以下得装另一个版本但是安装jcore@1.1.12时
Failed to install 'cordova-plugin-jcore':Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (D:\zouwendi\android\jpushDemo\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:920:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
爆出了这个错误
WARNING: 如果不按照这个表格,我们将无法帮助你,并将忽略你的问题。
你的运行环境
cordova -v
): 6.5.0cordova platform ls
): android 6.3.0期望效果
在ionic1中使用jpush,调取api成功
实际效果
无任何反应发生,在java处用toast打印,没有任何反应,我猜想是没有调用成功java代码.
重现步骤
`$ionicPlatform.ready(function () {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true);
} if (window.StatusBar) { // org.apache.cordova.statusbar required StatusBar.styleDefault(); } document.addEventListener('jpush.receiveRegistrationId', function (event) { alert(event) }, false) try { $cordovaAppVersion.getPackageName().then(function (res) { alert(res) }) $window.plugins.jPushPlugin.setDebugMode(true); $window.plugins.jPushPlugin.init(); $window.plugins.jPushPlugin.isPushStopped(function (res) { alert(res) }); $window.plugins.jPushPlugin.getRegistrationID(function (res) { alert(res) }) $window.plugins.jPushPlugin.getUserNotificationSettings(function (res) { alert(res)
} catch (res) { alert(res) }
document.addEventListener("jpush.openNotification", function (event) { var alertContent if (ionic.Platform.isAndroid()) { alertContent = event.alert } else { alertContent = event.aps.alert } alert(alertContent) }, false); });`
背景
我重新安装了一遍jcore与jpush-phonegap-plugin,并且js部分的代码调用成功,但是callback并不会发生,java部分的代码无任何反应 android studio 运行产生如下问题 Caused by: java.lang.ClassNotFoundException: Didn't find class "cn.jiguang.cordova.push.JPushPlugin" on path: DexPathList[[zip file "/data/app/com.quangao.pnlyjz-1/base.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.quangao.pnlyjz-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.quangao.pnlyjz-1/lib/x86, /system/lib, /vendor/lib]] 我找到了一个原因是 android 7.0以下得装另一个版本但是安装jcore@1.1.12时 Failed to install 'cordova-plugin-jcore':Error: cmd: Command failed with exit code 1 at ChildProcess.whenDone (D:\zouwendi\android\jpushDemo\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:920:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5) 爆出了这个错误