开发者社区> 问答> 正文

移动推送Android SDK:SDK报出"deviceId is empty"错误,应该如何做?



1.问题


集成推送SDK后出现如下文所示的appKey or deviceId为空的错误,这是怎么回事?

  1. [backcolor=transparent] com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]push[backcolor=transparent].[backcolor=transparent]impl[backcolor=transparent].[backcolor=transparent]IllegalKeyException[backcolor=transparent]:[backcolor=transparent]
  2. [backcolor=transparent] [backcolor=transparent]AppKey[backcolor=transparent] [backcolor=transparent]or[backcolor=transparent] deviceId [backcolor=transparent]is[backcolor=transparent] empty[backcolor=transparent]!
  3. [backcolor=transparent] at com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]push[backcolor=transparent].[backcolor=transparent]impl[backcolor=transparent].[backcolor=transparent]a[backcolor=transparent].[backcolor=transparent]c[backcolor=transparent]([backcolor=transparent]Unknown[backcolor=transparent] [backcolor=transparent]Source[backcolor=transparent])
  4. [backcolor=transparent] at com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]push[backcolor=transparent].[backcolor=transparent]impl[backcolor=transparent].[backcolor=transparent]a[backcolor=transparent].[backcolor=transparent]a[backcolor=transparent]([backcolor=transparent]Unknown[backcolor=transparent] [backcolor=transparent]Source[backcolor=transparent])
  5. [backcolor=transparent] at com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]push[backcolor=transparent].[backcolor=transparent]impl[backcolor=transparent].[backcolor=transparent]c[backcolor=transparent].[backcolor=transparent]onAppStart[backcolor=transparent]([backcolor=transparent]Unknown[backcolor=transparent] [backcolor=transparent]Source[backcolor=transparent])


2.解决方案


请按照如下步骤进行排查:
  1. 检查appKey是否有按文档指导方式正确集成;
  2. 确认SDK是否有正确初始化,若初始化失败deviceId是获取不到的;
  3. Android推送SDK部分参数是存储在DefaultSharedPreferences中的,其中包括deviceId,请检查项目中是否有对DefaultSharedPreferences做清空操作。

展开
收起
猫饭先生 2017-10-23 14:13:27 3308 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
跨平台的云服务SDK需要什么 立即下载
Android内存泄漏自动化链路分析组件Probe 立即下载
一个跨平台的云服务SDK需要什么 立即下载