RegistrationID为空

android
cordova
标签: #<Tag:0x00007fb84a0b5608> #<Tag:0x00007fb84a0b54c8>

(Bruce) #1

你好,我使用的是cordova框架开发App,环境配置如下:
cordova:7.0.0
jpush-phonegap-plugin:3.3.2
三星s7 android 7.0

代码如下:
window.JPush.getRegistrationID(function(data){
alert(data);
});

data为空字符串


#2

初始化需要一定的时间,请延后获取,可监听注册成功事件


(Bruce) #3

已经延后了相当长第一段时间,才去获取的


#4

那就看客户端日志,是否集成失败,失败是有报错的


(Bruce) #5

问题是也没有报错信息


#6

可否麻烦你取一下客户端日志,从初始化开始,开启debug,完整的客户端日志

完全取不到 registrationID就代表集成失败,集成失败必然有错误日志


(Bruce) #7

window.JPush.setDebugMode(true);这个代码也写上了,请问日志可以从什么地方拿到


(Bruce) #8

我的开发环境是webstorm


(Bruce) #9

日志文件已经拿到了,文件比较大


(Bruce) #10
06-27 17:11:33.563 17142 17268 D JIGUANG-JCore: [ServiceHelper] We found the appKey is changed or register appkey is empty. Will re-register.
06-27 17:11:33.566 17142 17142 D InputMethodManager: HSI from window - flag : 0 Pid : 17142
06-27 17:11:33.566  4473  8481 D InputMethodManagerService: mDesktopModeManager null!
06-27 17:11:33.566  4473  8481 V InputMethodManagerService: hideCurrentInputLocked - !shouldHideSoftInput
06-27 17:11:33.567 17142 17268 D JIGUANG-JCore: [JCoreGlobal] action:init - sdkVersion:1.2.1, buildId:188
06-27 17:11:33.567 17142 17268 E art     : No implementation found for int cn.jiguang.service.Protocol.GetSdkVersion() (tried Java_cn_jiguang_service_Protocol_GetSdkVersion and Java_cn_jiguang_service_Protocol_GetSdkVersion__)
06-27 17:11:33.567 17142 17268 E JIGUANG-JCore: [JCoreGlobal] Get sdk version fail![获取sdk版本失败!]
06-27 17:11:33.568 17142 17268 W System.err: java.lang.UnsatisfiedLinkError: No implementation found for int cn.jiguang.service.Protocol.GetSdkVersion() (tried Java_cn_jiguang_service_Protocol_GetSdkVersion and Java_cn_jiguang_service_Protocol_GetSdkVersion__)
06-27 17:11:33.568 17142 17268 W System.err: 	at cn.jiguang.service.Protocol.GetSdkVersion(Native Method)
06-27 17:11:33.568 17142 17268 W System.err: 	at cn.jiguang.d.a.a(Unknown Source)
06-27 17:11:33.568 17142 17268 W System.err: 	at cn.jiguang.d.a.d(Unknown Source)
06-27 17:11:33.568 17142 17268 W System.err: 	at cn.jiguang.d.a.b(Unknown Source)
06-27 17:11:33.568 17142 17268 W System.err: 	at cn.jiguang.api.JCoreInterface.init(Unknown Source)
06-27 17:11:33.568 17142 17268 W System.err: 	at cn.jiguang.api.JCoreInterface.getRegistrationID(Unknown Source)
06-27 17:11:33.568 17142 17268 W System.err: 	at cn.jpush.android.api.JPushInterface.getRegistrationID(SourceFile:226)
06-27 17:11:33.568 17142 17268 W System.err: 	at cn.jiguang.cordova.push.JPushPlugin.getRegistrationID(JPushPlugin.java:345)
06-27 17:11:33.568 17142 17268 W System.err: 	at java.lang.reflect.Method.invoke(Native Method)
06-27 17:11:33.568 17142 17268 W System.err: 	at cn.jiguang.cordova.push.JPushPlugin$5.run(JPushPlugin.java:249)
06-27 17:11:33.568 17142 17268 W System.err: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
06-27 17:11:33.568 17142 17268 W System.err: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
06-27 17:11:33.569 17142 17268 W System.err: 	at java.lang.Thread.run(Thread.java:762)
06-27 17:11:33.569 17142 17268 E JIGUANG-JCore: [JCoreGlobal] JCore .so file do not match JCore .jar file in the project, Failed to init JCore
06-27 17:11:33.569 17142 17268 W JIGUANG-JCore: [JCoreInterface] JCore init failed

#11

检查 JCore 加了没有: https://github.com/jpush/cordova-plugin-jcore

注意你的 cordova Android 版本