Skip to content Skip to sidebar Skip to footer

Android Crash /system/lib/libhwui.so

there is a crash i have got sometimes , it seems a jni crash , but my application have not any jni code . it's is a graphic application , and will load some pictures . could anyo

Solution 1:

I know this is an old post but I've been struggling with a similar crash for a long time and just recently found root cause. Here are a few more tidbits on my crash:

  • crash can be in libhwui.so, libskia.so, libutils.so, or libc.so
  • app is not using NDK
  • strong correlation to devices. Samsung S6/S7 and Nexus 5 had a lot of instances. Never saw the crash on an old Kyocera

Since my app also does not have native code the stack dump/tombstone file didn't reference any of my code. Through adhoc testing, I narrowed the source of the problem to a custom ProgressBar in the app.

The ProgressBar leveraged a TimerTask under the hood! Thankfully I had recently bumped into this post while researching something else.

Changed the code to a handler and haven't seen the crash since! Hope this helps someone else.

Solution 2:

I remember seeing a crash like this and reading about a bug with 4.0.x in particular where removing a hardware layer in an AnimationListener (onAnimationEnd()) would cause this sort of crash. The solution was to post the layer transition as a Runnable. For example:

@OverridepublicvoidonAnimationEnd(Animation animation) {
    //This will cause a crash
    setLayerType(LAYER_TYPE_NONE, null);
}

@OverridepublicvoidonAnimationEnd(Animation animation) {
    //This will work successfully
    post(newRunnable() {
        @Overridepublicvoidrun() {
            setLayerType(LAYER_TYPE_NONE, null);
        }
    }
}

Post a Comment for "Android Crash /system/lib/libhwui.so"