Closed wenwenwen888 closed 7 years ago
堆栈信息可以提供吗?OOM?
我的测试手机是HTC M8 , 我的闪退并不是整个APP崩溃 , 而是闪回我的Activity , 所以没有错误信息 , 如下图
@fishwjy 我也遇到了我也遇到了同样的问题,模拟器可以运行,真机(一加三)闪退后回到原来 Activity , Logcat 瞬间清空然后出现一堆新的 Logcat: 02-24 22:03:40.272 25718-25718/? I/art: Late-enabling -Xcheck:jni 02-24 22:03:40.312 25718-25718/? W/System: ClassLoader referenced unknown path: /data/app/com.vincent.filepickersample-1/lib/arm64 02-24 22:03:40.335 25718-25718/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 02-24 22:03:40.346 25718-25718/? D/PhoneWindow: state.preset = false, color: 0, translucent = 0 02-24 22:03:40.347 25718-25718/? D/PhoneWindow: state.preset = false, color: 0, translucent = 0 02-24 22:03:40.347 25718-25718/? D/PhoneWindow: state.preset = false, color: 0, translucent = 0 02-24 22:03:40.347 25718-25718/? D/PhoneWindow: state.preset = false, color: 0, translucent = 0 02-24 22:03:40.350 25718-25718/? D/PhoneWindow: state.preset = false, color: -16777216, translucent = 0 02-24 22:03:40.356 25718-25718/? V/BoostFramework: mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[]) 02-24 22:03:40.356 25718-25718/? V/BoostFramework: mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease() 02-24 22:03:40.356 25718-25718/? V/BoostFramework: mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[]) 02-24 22:03:40.356 25718-25718/? V/BoostFramework: mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String) 02-24 22:03:40.356 25718-25718/? V/BoostFramework: mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop() 02-24 22:03:40.357 25718-25718/? V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@cdab934 02-24 22:03:40.358 25718-25718/? V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@fc6e35d 02-24 22:03:40.382 25718-25718/? D/AppTracker: App Event: start 02-24 22:03:40.393 25718-25737/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 02-24 22:03:40.402 25718-25718/? D/PhoneWindow: state.preset = true, color: -16777216, translucent = 0 02-24 22:03:40.418 25718-25737/? I/Adreno: QUALCOMM build : 19f8f74, Iac38d51750 Build Date : 06/06/16 OpenGL ES Shader Compiler Version: XE031.07.00.01 Local Branch : case2489916_Unmap_crash Remote Branch : Remote Branch : Reconstruct Branch : 02-24 22:03:40.421 25718-25737/? I/OpenGLRenderer: Initialized EGL, version 1.4 02-24 22:03:40.458 25718-25737/? E/HAL: load: gralloc.msm8996.so 02-24 22:03:40.772 25718-25718/? D/AbstractTracker: Event success starkoverflow 上有说是 instant run,但是我并没有开。min 设置改为16也无济于事。
@wenwenwen888 @ChiakiMayuzumi 增加了本地Exception日志记录,请运行一下Demo,将SD卡根目录下crash_multi_type_file_picker.log文件的内容贴出来,谢谢!
运行了,根目录下无crash_multi_type_file_picker.log文件生成= =
@fishwjy 测试了一下午 , 大概知道是怎么回事了 , 用DDMS才能显示出错误的信息
"E/JavaBinder(441): !!! FAILED BINDER TRANSACTION !!! TransactionSize: scheduleLaunchActivity(), TransactionTooLargeException, data size = 1409448, Intent = Intent { cmp=com.wyt.list/com.vincent.filepicker.activity.ImageBrowserActivity (has extras) }"
因为intent传的值太大了 , 就是那个序列化后的 mList 参数的数据字节超过了我的手机的内存 , 我打印出来我的mList.size = 4212「说明我有4212张照片」 , 因此导致Activity闪崩了.
参考文章: http://blog.csdn.net/axuanqq/article/details/51346236 http://stackoverflow.com/questions/19066589/transactiontoolargeexception-when-sending-large-data-through-intent-extras http://stackoverflow.com/questions/11451393/what-to-do-on-transactiontoolargeexception
明白了,我考虑一下怎么改,谢谢!
已修改
进入到图片选择界面之后 , 单击图片闪退