两部 Android 5.1 的机型获取不到这个 registrationID


(Gzp) #1

目前两部 Android 5.1 的机型都获取不到这个 registrationID ,分别是 OPPO R9m, 魅族 MX5 ,其他测试机都可行。
我是在项目的 Application 里边对极光进行的初始化操作,又在 MainActivity 里边进行了一遍初始化操作,然后延迟5秒去获取 registrationID ,但是还是获取不到,之前用的 3.1.5 版本的 SDK,在这两部机型上连极光的进程都没有,后面换了最新的 3.1.6 的 SDK ,极光的进程有了,但还是没有获取到 registrationID, 我开了日志,但是却没有日志打印,所以我也无法查看到极光的日志输出,是怎么回事呢?


部分机型获取不到registerId
#2

没有日志信息的话检查一下你这个手机是不是有特殊的日志权限开启要求,除了开发者调试开启之外

取到完整的日志信息才好分析,你可以安装我们的官方 demo 在你的手机上测试看看。


(Gzp) #3

以下是魅族 MX5 打印出来的日志,麻烦工程师看一下是什么原因

11-02 11:24:56.744 13110-13133/? W/JIGUANG-JCore: [AndroidUtil] We recommend DataProvider's process same as PushService
11-02 11:24:56.745 13110-13133/? W/JIGUANG-JCore: [AndroidUtil] AndroidManifest.xml missing required service: cn.jpush.android.service.DaemonService
11-02 11:24:56.753 13110-13133/? E/JIGUANG-JCore: [AndroidUtil] The permissoin is required - android.permission.WRITE_SETTINGS
11-02 11:24:56.802 13110-13133/? W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
    [JCoreGlobal] JCore init code = 11
11-02 11:24:56.909 13140-13164/com.tuner168.magichome:mult W/JIGUANG-JCore: [AndroidUtil] We recommend DataProvider's process same as PushService
11-02 11:24:56.911 13140-13164/com.tuner168.magichome:mult W/JIGUANG-JCore: [AndroidUtil] AndroidManifest.xml missing required service: cn.jpush.android.service.DaemonService
11-02 11:24:56.925 13140-13164/com.tuner168.magichome:mult E/JIGUANG-JCore: [AndroidUtil] The permissoin is required - android.permission.WRITE_SETTINGS
11-02 11:24:56.943 13140-13164/com.tuner168.magichome:mult W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
    [JCoreGlobal] JCore init code = 11
    [PushService] onCreate:JCoreInterface init failed
    [JCoreGlobal] JCore init code = 11
11-02 11:24:56.945 13140-13164/com.tuner168.magichome:mult W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
11-02 11:24:56.990 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
11-02 11:24:57.377 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
    [JCoreGlobal] JCore init code = 11
11-02 11:24:57.378 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
    [JCoreGlobal] JCore init code = 11
11-02 11:25:03.164 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
    [PushReceiver] onReceive :JCoreInterface init failed
11-02 11:25:08.760 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
11-02 11:25:12.908 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
    [JCoreGlobal] JCore init code = 11
11-02 11:25:13.060 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
11-02 11:25:13.373 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
11-02 11:25:13.374 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
11-02 11:25:27.847 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
11-02 11:25:29.064 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
11-02 11:25:36.416 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
11-02 11:25:36.736 13110-13133/com.tuner168.magichome W/JIGUANG-JCore: [JCoreGlobal] JCore init code = 11
    [JCoreGlobal] JCore init code = 11

#4

看这个日志,缺少权限配置。

检查下你的 Androidmanifest。包名等


(Gzp) #5

谢谢大佬,Android5.1 的手机加上了 android.permission.WRITE_SETTINGS 这个权限后,就可以拿到 registrationID 了,推送就没问题了