开发者社区> 问答> 正文

移动推送Android SDK:集成后偶尔Crash,报NoClassDefFoundError



1.问题


集成移动推送后报类似下述错误:或报:

  1. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.907[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent] java[backcolor=transparent].[backcolor=transparent]lang[backcolor=transparent].[backcolor=transparent]ExceptionInInitializerError
  2. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.907[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]ams[backcolor=transparent].[backcolor=transparent]common[backcolor=transparent].[backcolor=transparent]spi[backcolor=transparent].[backcolor=transparent]ServiceFactoryFactory[backcolor=transparent].[backcolor=transparent]getFactory[backcolor=transparent]([backcolor=transparent]Unknown[backcolor=transparent] [backcolor=transparent]Source[backcolor=transparent])
  3. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.907[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]ams[backcolor=transparent].[backcolor=transparent]common[backcolor=transparent].[backcolor=transparent]securitybox[backcolor=transparent].[backcolor=transparent]SecurityBoxServiceFactory[backcolor=transparent].[backcolor=transparent]getSecurityBoxService[backcolor=transparent]([backcolor=transparent]Unknown[backcolor=transparent] [backcolor=transparent]Source[backcolor=transparent])
  4. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.907[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[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]AgooMessageReceiver[backcolor=transparent].[backcolor=transparent]onReceive[backcolor=transparent]([backcolor=transparent]Unknown[backcolor=transparent] [backcolor=transparent]Source[backcolor=transparent])
  5. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.917[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at android[backcolor=transparent].[backcolor=transparent]app[backcolor=transparent].[backcolor=transparent]ActivityThread[backcolor=transparent].[backcolor=transparent]handleReceiver[backcolor=transparent]([backcolor=transparent]ActivityThread[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]2582[backcolor=transparent])
  6. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.917[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at android[backcolor=transparent].[backcolor=transparent]app[backcolor=transparent].[backcolor=transparent]ActivityThread[backcolor=transparent].[backcolor=transparent]access$1700[backcolor=transparent]([backcolor=transparent]ActivityThread[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]147[backcolor=transparent])
  7. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.917[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at android[backcolor=transparent].[backcolor=transparent]app[backcolor=transparent].[backcolor=transparent]ActivityThread$H[backcolor=transparent].[backcolor=transparent]handleMessage[backcolor=transparent]([backcolor=transparent]ActivityThread[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]1360[backcolor=transparent])
  8. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.917[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at android[backcolor=transparent].[backcolor=transparent]os[backcolor=transparent].[backcolor=transparent]Handler[backcolor=transparent].[backcolor=transparent]dispatchMessage[backcolor=transparent]([backcolor=transparent]Handler[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]102[backcolor=transparent])
  9. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.917[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at android[backcolor=transparent].[backcolor=transparent]os[backcolor=transparent].[backcolor=transparent]Looper[backcolor=transparent].[backcolor=transparent]loop[backcolor=transparent]([backcolor=transparent]Looper[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]135[backcolor=transparent])
  10. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.927[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at android[backcolor=transparent].[backcolor=transparent]app[backcolor=transparent].[backcolor=transparent]ActivityThread[backcolor=transparent].[backcolor=transparent]main[backcolor=transparent]([backcolor=transparent]ActivityThread[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]5235[backcolor=transparent])
  11. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.927[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at java[backcolor=transparent].[backcolor=transparent]lang[backcolor=transparent].[backcolor=transparent]reflect[backcolor=transparent].[backcolor=transparent]Method[backcolor=transparent].[backcolor=transparent]invoke[backcolor=transparent]([backcolor=transparent]Native[backcolor=transparent] [backcolor=transparent]Method[backcolor=transparent])
  12. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.927[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at java[backcolor=transparent].[backcolor=transparent]lang[backcolor=transparent].[backcolor=transparent]reflect[backcolor=transparent].[backcolor=transparent]Method[backcolor=transparent].[backcolor=transparent]invoke[backcolor=transparent]([backcolor=transparent]Method[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]372[backcolor=transparent])
  13. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.927[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at com[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]internal[backcolor=transparent].[backcolor=transparent]os[backcolor=transparent].[backcolor=transparent]ZygoteInit$MethodAndArgsCaller[backcolor=transparent].[backcolor=transparent]run[backcolor=transparent]([backcolor=transparent]ZygoteInit[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]906[backcolor=transparent])
  14. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.927[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at com[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]internal[backcolor=transparent].[backcolor=transparent]os[backcolor=transparent].[backcolor=transparent]ZygoteInit[backcolor=transparent].[backcolor=transparent]main[backcolor=transparent]([backcolor=transparent]ZygoteInit[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]701[backcolor=transparent])
  15. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.927[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent] [backcolor=transparent]Caused[backcolor=transparent] [backcolor=transparent]by[backcolor=transparent]:[backcolor=transparent] java[backcolor=transparent].[backcolor=transparent]lang[backcolor=transparent].[backcolor=transparent]IllegalStateException[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]Fail[backcolor=transparent] to load ams[backcolor=transparent]-[backcolor=transparent]spi[backcolor=transparent]-[backcolor=transparent]services [backcolor=transparent]for[backcolor=transparent] com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]ams[backcolor=transparent].[backcolor=transparent]common[backcolor=transparent].[backcolor=transparent]spi[backcolor=transparent].[backcolor=transparent]FactoryProvider
  16. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.937[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]ams[backcolor=transparent].[backcolor=transparent]common[backcolor=transparent].[backcolor=transparent]spi[backcolor=transparent].[backcolor=transparent]ServiceLoaderUtils[backcolor=transparent].[backcolor=transparent]getServices[backcolor=transparent]([backcolor=transparent]Unknown[backcolor=transparent] [backcolor=transparent]Source[backcolor=transparent])
  17. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.937[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]ams[backcolor=transparent].[backcolor=transparent]common[backcolor=transparent].[backcolor=transparent]spi[backcolor=transparent].[backcolor=transparent]LazyLoadProviderHolder[backcolor=transparent].<[backcolor=transparent]clinit[backcolor=transparent]>([backcolor=transparent]Unknown[backcolor=transparent] [backcolor=transparent]Source[backcolor=transparent])
  18. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.937[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     [backcolor=transparent][backcolor=transparent] [backcolor=transparent]13[backcolor=transparent] more04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.937[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent] [backcolor=transparent]Caused[backcolor=transparent] [backcolor=transparent]by[backcolor=transparent]:[backcolor=transparent] java[backcolor=transparent].[backcolor=transparent]io[backcolor=transparent].[backcolor=transparent]FileNotFoundException[backcolor=transparent]:[backcolor=transparent] ams[backcolor=transparent]-[backcolor=transparent]spi[backcolor=transparent]-[backcolor=transparent]services[backcolor=transparent]/[backcolor=transparent]com[backcolor=transparent].[backcolor=transparent]alibaba[backcolor=transparent].[backcolor=transparent]sdk[backcolor=transparent].[backcolor=transparent]android[backcolor=transparent].[backcolor=transparent]ams[backcolor=transparent].[backcolor=transparent]common[backcolor=transparent].[backcolor=transparent]spi[backcolor=transparent].[backcolor=transparent]FactoryProvider
  19. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.937[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at android[backcolor=transparent].[backcolor=transparent]content[backcolor=transparent].[backcolor=transparent]res[backcolor=transparent].[backcolor=transparent]AssetManager[backcolor=transparent].[backcolor=transparent]openAsset[backcolor=transparent]([backcolor=transparent]Native[backcolor=transparent] [backcolor=transparent]Method[backcolor=transparent])
  20. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.937[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at android[backcolor=transparent].[backcolor=transparent]content[backcolor=transparent].[backcolor=transparent]res[backcolor=transparent].[backcolor=transparent]AssetManager[backcolor=transparent].[backcolor=transparent]open[backcolor=transparent]([backcolor=transparent]AssetManager[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]317[backcolor=transparent])
  21. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.937[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     at android[backcolor=transparent].[backcolor=transparent]content[backcolor=transparent].[backcolor=transparent]res[backcolor=transparent].[backcolor=transparent]AssetManager[backcolor=transparent].[backcolor=transparent]open[backcolor=transparent]([backcolor=transparent]AssetManager[backcolor=transparent].[backcolor=transparent]java[backcolor=transparent]:[backcolor=transparent]291[backcolor=transparent])
  22. [backcolor=transparent]04[backcolor=transparent]-[backcolor=transparent]06[backcolor=transparent] [backcolor=transparent]20[backcolor=transparent]:[backcolor=transparent]48[backcolor=transparent]:[backcolor=transparent]22.937[backcolor=transparent]:[backcolor=transparent] W[backcolor=transparent]/[backcolor=transparent]System[backcolor=transparent].[backcolor=transparent]err[backcolor=transparent]([backcolor=transparent]8631[backcolor=transparent]):[backcolor=transparent]     [backcolor=transparent][backcolor=transparent] [backcolor=transparent]15[backcolor=transparent] more


2.问题原因


一般这是由于APK未携带assets文件夹导致的,有两种可能:

  1. 您打包出来的APK未携带assets文件夹;请确认您打包出来地APK文件解压后携带assets文件夹,如未携带,请确认您的打包方式是否正常;

  2. 您的手机在拷贝APK时未正常拷贝assets文件夹(目前已知有部分手机ROM偶尔安装会出现上述问题);您可以从/data/app/**.apk路径获取手机拷贝的APK文件,解压确认是否携带assets文件夹,如未携带,请重新覆盖安装;


3.解决方案


在2.3.2版本中已经修复该bug,如果您需要上述错误,请更新推送SDK

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

相关电子书

更多
58同城Android客户端Walle框架演进与实践之路 立即下载
Android组件化实现 立即下载
蚂蚁聚宝Android秒级编译——Freeline 立即下载