Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.19.0以上版本ToastUtils导致应用闪退 #660

Closed
DaiFalin opened this issue Oct 9, 2018 · 10 comments
Closed

1.19.0以上版本ToastUtils导致应用闪退 #660

DaiFalin opened this issue Oct 9, 2018 · 10 comments

Comments

@DaiFalin
Copy link

DaiFalin commented Oct 9, 2018

机型:小米5
Android版本:魔趣8.1
调用ToastUtils.showShort(),第一次弹出成功,第二次弹出应用崩溃。
IDE看到的错误为:libc: Fatal signal 6 (SIGABRT), code -6
使用1.19.0版本不会出现这个错误。

@Blankj
Copy link
Owner

Blankj commented Oct 9, 2018

用最新版本呢?最新版本已经修复的

@DaiFalin
Copy link
Author

用最新版本呢?最新版本已经修复的

就是升级到1.20.4发现的这个问题,然后回退到1.19.0就没有问题了

@Blankj
Copy link
Owner

Blankj commented Oct 12, 2018

Toast toast = Toast.makeText(context, "", duration);
toast.setText(text);
toast.show();

你在你手机上测试下这段代码,如果会崩那就是这代码的问题

@DaiFalin
Copy link
Author

Toast toast = Toast.makeText(context, "", duration);
toast.setText(text);
toast.show();

你在你手机上测试下这段代码,如果会崩那就是这代码的问题

单独测试了代码是没有问题的,用Demo测试也不会有问题,但是项目里的升级到1.20.4版本就会出现问题。

@DaiFalin
Copy link
Author

这是我从小米崩溃日志复制的,运行Demo是不会出错的,我也不知道是不是项目的问题,是不是跟其他库冲突了。
Build fingerprint: 'Xiaomi/gemini/gemini:8.0.0/OPR1.170623.032/8.9.20:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 22712, tid: 22712, name: 60.neweducation >>> com.stjy360.neweducation <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'unknown bitmap configuration'
r0 00000000 r1 000058b8 r2 00000006 r3 00000008
r4 000058b8 r5 000058b8 r6 ffe47658 r7 0000010c
r8 ffe47c24 r9 ffe47c40 sl 00000000 fp e59a7230
ip 00000000 sp ffe47648 lr e692e9a7 pc e695f10c cpsr 200f0010

backtrace:
#00 pc 0004b10c /system/lib/libc.so (tgkill+12)
#1 pc 0001a9a3 /system/lib/libc.so (abort+54)
#2 pc 00006699 /system/lib/liblog.so (__android_log_assert+152)
#3 pc 00024f5d /system/lib/libhwui.so (_ZN7androidL14allocateBitmapEP8SkBitmapP12SkColorTablePF5sk_spINS_6BitmapEEjRK11SkImageInfojS3_E+108)
#4 pc 0002551f /system/lib/libhwui.so (_ZN7android6Bitmap18allocateHeapBitmapEP8SkBitmapP12SkColorTable+6)
#5 pc 000d1af3 /system/lib/libandroid_runtime.so (_ZN13HeapAllocator13allocPixelRefEP8SkBitmapP12SkColorTable+18)
#6 pc 0017310d /system/lib/libskia.so (_ZN8SkBitmap14tryAllocPixelsEPNS_9AllocatorEP12SkColorTable+52)
#7 pc 000cc879 /system/lib/libandroid_runtime.so (ZL8doDecodeP7_JNIEnvP18SkStreamRewindableP8_jobjectS4+2712)
#8 pc 00a3ea1d /system/framework/arm/boot-framework.oat (offset 0x5dd000) (android.graphics.BitmapFactory.nativeDecodeAsset+156)
#9 pc 00066553 /dev/ashmem/dalvik-jit-code-cache (deleted)

@Blankj
Copy link
Owner

Blankj commented Oct 16, 2018

试试 1.21.0 版本

@DaiFalin
Copy link
Author

试试 1.21.0 版本

还是会出现上面的错误,1.19.1版本不会

@Blankj
Copy link
Owner

Blankj commented Oct 17, 2018

你看我源码里也就是这样实现的啊

Toast toast = Toast.makeText(context, "", duration);
toast.setText(text);
toast.show();

你测试了没有问题,那到底咋回事,我 demo 也没问题,那你新建个项目呢,或者说你这个项目最终打进去的版本不对?

@DaiFalin
Copy link
Author

你看我源码里也就是这样实现的啊

Toast toast = Toast.makeText(context, "", duration);
toast.setText(text);
toast.show();

你测试了没有问题,那到底咋回事,我 demo 也没问题,那你新建个项目呢,或者说你这个项目最终打进去的版本不对?

我再试试

@DaiFalin
Copy link
Author

DaiFalin commented Oct 19, 2018

我发现1.19.0以上可能是跟我项目里面导入的QMUI不兼容,估计是这个原因,不使用ToastUtils就不会。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants