tgkill - native error on Android 8.0 Samsung S8

最后都变了- 提交于 2019-11-30 12:08:20

Logcat analysis

This is where your code is crashing EglManager.cpp:

void EglManager::damageFrame(const Frame& frame, const SkRect& dirty) {
#ifdef EGL_KHR_partial_update
    if (EglExtensions.setDamage && mSwapBehavior == SwapBehavior::BufferAge) {
        EGLint rects[4];
        frame.map(dirty, rects);
        if (!eglSetDamageRegionKHR(mEglDisplay, frame.mSurface, rects, 1)) {
            LOG_ALWAYS_FATAL("Failed to set damage region on surface %p, error=%s",
                    (void*)frame.mSurface, egl_error_str());
        }
    }
#endif
}

Called from SkiaOpenGLPipeline.cpp:

SkiaOpenGLPipeline::draw //method

mEglManager.damageFrame(frame, dirty);

Why ?

It seems you may have a 'Failed to set damage region on surface', probably after onResume() from screen rotation or onPause() in your Activity. See fixing-common-android-lifecycle-issues

Fixes

I started getting this crash after updating to Oreo, every-time I started my app, with the message "Failed to set damage region on surface" followed by all those lines about libhwui.so and EglManager And it turned out that, for some obscure reason, it was somehow caused by a totally unrelated problem in my app (too many open files [forgot to close them]). After fixing this my own bug, no more crashes on the EglManager. [also note that crashes only happen if hardware acceleration is turned on] Ref: issuetracker.google.com { issue 70259031}

See also: eglCreateWindowSurface {SO problem}, Logging, native-crashes-on-abort-in-developer-console-with-oreo-8-1 {SO problem}, hardware-acceleration, opengl, GLSurfaceView

This problem seems to be restricted to Samsung devices with Android 8.0, it is some bug about text selection and/or entering text and/or closing a dialog containing EditTexts and/or rotating the screen.

It seems that there is a workaround. Create a xml file in the res/drawable folder defining an empty shape, as follows.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<!-- nothing -->
</shape>

In the layout file, add the following attributes to the EditTexts:

android:textSelectHandle="@drawable/empty"
android:textSelectHandleRight="@drawable/empty"
android:textSelectHandleLeft="@drawable/empty"

source: Samsung developers forum crash Samsung Galaxy S8 libhwui.so

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!