全部产品
云市场
云游戏

iOS 统一存储模块与百度地图冲突引起崩溃

更新时间:2020-04-28 19:34:27

问题描述

在引入统一存储和特定版本的百度地图 SDK 后,APP 在启动阶段产生崩溃。
崩溃调用栈如下:

  1. Thread 12 name: Dispatch queue: NSOperationQueue 0x1040a1ed0 (QOS: UNSPECIFIED)
  2. Thread 12 Crashed:
  3. 0 libsystem_kernel.dylib 0x00000001826f92e0 __pthread_kill + 8
  4. 1 libsystem_pthread.dylib 0x000000018289a288 pthread_kill$VARIANT$mp + 376
  5. 2 libsystem_c.dylib 0x0000000182667d0c abort + 140
  6. 3 libsystem_malloc.dylib 0x0000000182731838 szone_size + 0
  7. 4 ************** 0x0000000101604a30 _baidu_vi::CVString::Empty+ 9390640 () + 32
  8. 5 ************** 0x00000001016013b4 xmlFreeDoc + 48
  9. 6 ************** 0x00000001016013a0 xmlFreeDoc + 28
  10. 7 ************** 0x00000001016013a0 xmlFreeDoc + 28
  11. 8 ************** 0x00000001016013a0 xmlFreeDoc + 28
  12. 9 ************** 0x0000000101d7cb78 -[RVDDXMLNode dealloc] + 17222520 (RVDDXMLNode.m:282)
  13. 10 ************** 0x0000000101d916b0 -[APDAOConfig compile] + 17307312 (APDAOConfig.m:138)
  14. 11 CoreFoundation 0x0000000182c7a580 __invoking___ + 144
  15. 12 CoreFoundation 0x0000000182b59748 -[NSInvocation invoke] + 284
  16. 13 Foundation 0x000000018369b308 -[NSInvocationOperation main] + 40
  17. 14 Foundation 0x00000001835dbcac -[__NSOperationInternal _start:] + 848
  18. 15 Foundation 0x000000018369c76c __NSOQSchedule_f + 404
  19. 16 libdispatch.dylib 0x0000000182564a60 _dispatch_client_callout + 16
  20. 17 libdispatch.dylib 0x000000018256ce94 _dispatch_continuation_pop$VARIANT$mp + 424
  21. 18 libdispatch.dylib 0x000000018256b7cc _dispatch_async_redirect_invoke$VARIANT$mp + 604
  22. 19 libdispatch.dylib 0x0000000182571cac _dispatch_root_queue_drain + 588
  23. 20 libdispatch.dylib 0x00000001825719fc _dispatch_worker_thread3 + 120
  24. 21 libsystem_pthread.dylib 0x0000000182897fac _pthread_wqthread + 1176
  25. 22 libsystem_pthread.dylib 0x0000000182897b08 start_wqthread + 4

Thread5

解决办法

在 App 初始化阶段(可以在 main 函数中)添加如下代码:

  1. #import <MPDataCenter/APDataCenter.h>
  2. // App 初始化方法中设置
  3. APDataCenter.compatibility = YES;
说明:该方法在 10.1.32 及以上基线版本有效。