开发中依赖高德地图sdk
implementation 'com.amap.api:search:8.1.0'
implementation 'com.amap.api:3dmap:9.1.0'
使用中并无问题,但在页面finish的时候按照文档销毁资源的时候却出现了问题。
代码如下,我在页面销毁时,调用销毁地图资源的方法,并在前后都加上了日志。
@Override
public void onDestroy() {
super.onDestroy();
Log.d(TAG, "onDestroy()");
if (null != mMapView) {
Log.d(TAG, "mMapView onDestroy()");
mMapView.onDestroy();
Log.d(TAG, "mMapView onDestroy() end");
}
}
结果在退出页面后,app就崩了。日志如下:
2022-03-01 13:43:35.836 24488-24488/X D/Y : [main]onDestroy()
2022-03-01 13:43:35.836 24488-24488/X D/Y : [main]mMapView onDestroy()
--------- beginning of crash
2022-03-01 13:43:35.860 24488-25187/X A/libc: Pointer tag for 0x7b1ad2f750 was truncated.
2022-03-01 13:43:35.860 24488-25187/X I/DEBUG: begin to generate native report
2022-03-01 13:43:35.860 24488-25187/X I/crashsdk: [DEBUG] Release reserved memory: 0x7a77106000 3145728
2022-03-01 13:43:35.861 24488-25187/X I/crashsdk: [DEBUG] Crash log file path: /data/user/0/X/crashsdk/logs/6178c6ade014255fcb5d20ee_1.0.02_e8cb1ca3_TFY-AN00_11_164611338785133588_20220301134335_fg_jni.log
2022-03-01 13:43:35.862 24488-25187/X I/crashsdk: [DEBUG] Opened file: 83
2022-03-01 13:43:35.862 24488-25187/X I/crashsdk: [DEBUG] Create tag: 1
2022-03-01 13:43:35.862 24488-25187/X I/crashsdk: [DEBUG] Filter callback returned
2022-03-01 13:43:35.862 24488-25187/X I/crashsdk: [DEBUG] Call GenerateDump
2022-03-01 13:43:35.862 24488-25187/X I/crashsdk: [DEBUG] pipes: 151 152, 153 154
2022-03-01 13:43:35.880 24488-25187/X I/crashsdk: [DEBUG] After sys_clone, pid: 24488, tid: 25187
2022-03-01 13:43:36.063 24488-24655/X I/DEBUG: Resume native log stat thread 24655
2022-03-01 13:43:36.863 24488-25187/X I/crashsdk: [DEBUG] zip_log, rtn: 2, timeout or died: 0
2022-03-01 13:43:36.863 24488-25187/X I/crashsdk: [DEBUG] BreakpadClient.zipLog, rtn: 2
2022-03-01 13:43:39.785 24488-24529/X E/HiEvent: length is 0 or exceed MAX: 1024
2022-03-01 13:43:39.785 24488-24529/X E/HiEvent: uid = 10181
pid = 24488
packageName = X
processName = X
APPEYE_UIP_WARNING
activityName = X
versionName = 1.0.02
Message 0: { when=-3s977ms what=149 obj=android.os.BinderProxy@96f25e0 target=android.app.ActivityThread$H }
Message 1: { when=-3s961ms callback=android.view.-$$Lambda$Choreographer$zXV0PrqwmpdPajenUBozqc6c8Hs target=android.view.Choreographer$FrameHandler }
Message 2: { when=-3s955ms callback=android.view.ViewRootImpl$ConsumeBatchedInputImmediatelyRunnable target=android.view.ViewRootImpl$ViewRootHandler }
Message 3: { when=-3s954ms barrier=157 }
Message 4: { when=-3s948ms callback=com.amap.api.mapcore.util.dv$2 target=com.amap.api.mapcore.util.b$1 }
Message 5: { when=-3s854ms callback=android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent target=android.view.ViewRootImpl$ViewRootHandler }
Message 6: { when=-3s268ms what=131 obj=android.app.ActivityThread$ProviderRefCount@dbff8ea target=android.app.ActivityThread$H }
2022-03-01 13:43:39.785 24488-24529/X I/HiView: Begin report 1000
2022-03-01 13:43:39.786 24488-24529/X I/HiEvent: Flatten done: 1000
2022-03-01 13:43:39.786 24488-24529/X D/X : [ZeroHung]ZrhungDoSendWithHievent: hievent send wp = 257, pid= 24488, tid = 24529
2022-03-01 13:43:39.883 24488-25187/X I/crashsdk: [DEBUG] onCrashLogGenerated: child process 25261, timeout or died in 3000 ms.
2022-03-01 13:43:39.883 24488-25187/X I/DEBUG: generate native report finished
2022-03-01 13:43:39.884 24488-25187/X D/crashsdk: not restart, interval: 1646113420 < -1
2022-03-01 13:43:39.884 24488-25187/X I/crashsdk: [DEBUG] Call native default handler: 0
如上显示, "mMapView onDestroy()"日志正常输出,但是却没有"mMapView onDestroy() end"的日志,实际上我打断点追进去也确定了,崩溃就是发生在MapView的onDestory方法内部,但里面都是混淆过的代码,实在找不到原因。
而且这崩溃并没有抛出明确的异常,我用try-catch没有效果;将其放入子线程也无法阻止应用崩溃。询问客服也是一问三不知。
求问大家有没有遇到相同情况解决了的,或者使用相同的sdk和方法却没有出问题的,请帮忙给点思路。