yuyashuai / FrameAnimation

High-Performance Frame Animation Library For Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

捕获到Native崩溃

OumaSyuu opened this issue · comments

commented

我这边在release版本被用户调用时,bugly抓到了native的崩溃,log如下:

1 #00 pc 0001a078 /system/lib/libc.so (memset+60) [armeabi-v7a]

#1 pc 0010f135 /system/lib/libhwui.so (SkCanvas::writePixels(SkImageInfo const&, void const*, unsigned int, int, int)+72) [armeabi-v7a]
#2 pc 00372843 /system/lib/libhwui.so [armeabi-v7a]
#3 pc 0036ac37 /system/lib/libhwui.so [armeabi-v7a]
#4 pc 0033dbf5 /system/lib/libhwui.so (SkCanvas::internalDrawPaint(SkPaint const&)+224) [armeabi-v7a]
#5 pc 00370bd9 /system/lib/libhwui.so (SkCanvas::drawColor(unsigned int, SkBlendMode)+40) [armeabi-v7a]
#6 pc 003f3d61 /system/framework/arm/boot-framework.oat [armeabi]
8 java:
9 android.graphics.BaseCanvas.drawColor(BaseCanvas.java:243)
10 android.graphics.Canvas.drawColor(Canvas.java:1631)
11 g.h.a.f.c.clear(TextureBitmapDrawer.kt:2)
12 g.h.a.d.invoke(FrameAnimation.kt:50)
13 g.h.a.d.invoke(FrameAnimation.kt:1)
14 h.x.a.run(Thread.kt:1)

commented

调用设置为
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { ... calling.setScaleType(FrameAnimation.ScaleType.CENTER_INSIDE); calling.setRepeatMode(FrameAnimation.RepeatMode.REVERSE_INFINITE); calling.setFrameInterval(100); calling.setSupportInBitmap(true); calling.playAnimationFromAssets("animationCall"); ... }
在调用的activity里面onDestroy()里面stopAnimation();
我这边有两个不同的activity调用不同的动画,这两个activity一前一后顺序显示,一样的配置,但是会出现偶发性的崩溃。

commented

找到一条可能有用的信息:
https://stackoverflow.com/questions/30895898/textureview-keeps-getting-sigsegv-11
如果爆栈基佬说的话准确,FrameAnimation.kt中stopAnimation()的drawThread用join()会比interrupt()好点。

好的 最近会对各种问题修改一波

TextureView,在页面生命周期 onDestory 里stopAnimation也会报类似的错误,但在 onStop 里就不会有问题

commented

+1 同样遇到native crash。
触发场景是:动画页面在播放到一半时,突然来了个电话然后屏幕变成通话页面,挂掉电话重新回到动画页面 发生native crash。经过测试这个不一定必须电话页面,只要是动画播到一半然后弹出一个页面覆盖后再回到动画页面就有很大几率native grash。(已在动画页面的onPause和onStop里都试过调用stopAnim方法,但是依旧大概率出现native crash)

+1 同样遇到native crash。
触发场景是:动画页面在播放到一半时,突然来了个电话然后屏幕变成通话页面,挂掉电话重新回到动画页面 发生native crash。经过测试这个不一定必须电话页面,只要是动画播到一半然后弹出一个页面覆盖后再回到动画页面就有很大几率native grash。(已在动画页面的onPause和onStop里都试过调用stopAnim方法,但是依旧大概率出现native crash)

尝试复现没有成功,请问是什么机型呢,什么系统版本呢?