在开发人员控制台中,我在中止时遇到越来越多的本机崩溃.这只发生在Android 8.1设备上!有人知道回归吗?这是回溯:
#00 pc 000000000001da4c /system/lib64/libc.so (abort+112)
#01 pc 0000000000007f7c /system/lib64/liblog.so (__android_log_assert+312)
#02 pc 000000000006cff8 /system/lib64/libhwui.so (android::uirenderer::renderthread::EglManager::createSurface(ANativeWindow*, bool)+324)
#03 pc 000000000006ad14 /system/lib64/libhwui.so (android::uirenderer::renderthread::OpenGLPipeline::setSurface(android::Surface*, android::uirenderer::renderthread::SwapBehavior, android::uirenderer::renderthread::ColorMode)+72)
#04 pc 00000000000679ec /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::setSurface(android::Surface*)+144)
#05 pc 00000000000703bc /system/lib64/libhwui.so (android::uirenderer::renderthread::Bridge_initialize(android::uirenderer::renderthread::initializeArgs*)+16)
#06 pc 00000000000726c4 /system/lib64/libhwui.so (android::uirenderer::renderthread::MethodInvokeRenderTask::run()+24)
#07 pc 00000000000738d8 /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+336)
#08 pc 0000000000011504 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+264)
#09 pc 00000000000a9830 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
#10 pc 0000000000069c94 /system/lib64/libc.so (__pthread_start(void*)+36)
#11 pc 000000000001eeec /system/lib64/libc.so (__start_thread+68)
Run Code Online (Sandbox Code Playgroud)
更新:我想这个问题只能由Google自己解决:(此处跟踪问题https://issuetracker.google.com/issues/70259031
与此同时,有人可能已经重现此问题或至少解释问题何时发生?这有助于找到解决方法!
当清单文件中 android:hardwareAccelerated 设置为 false 时,我遇到的问题仅出现在最新的 Samsung Galaxy 系列中
据我所知(我自己尝试过),它会发生在 Galaxy S9、J6 和 Note 8 上,但不会发生在 Galaxy S8 上。其他手机似乎根本不受影响。
问题是我的 GLSurfaceView 不显示任何内容(黑屏),但如果我在活动之间切换,它会再次开始工作,我猜是因为它更新了视图而没有错误。
这是我发现的可疑日志行
01-13 14:39:47.813 25013 25080 E libEGL : eglCreateWindowSurface: native_window_api_connect (win=0xc166b808) failed (0xffffffed) (already connected to another API?)
01-13 14:39:47.813 25013 25080 E libEGL : eglCreateWindowSurface:679 error 3003 (EGL_BAD_ALLOC)
Run Code Online (Sandbox Code Playgroud)
这些是我的代码的关键部分:
GLSurf glsurf;
public void onPause() {
super.onPause();
// stop
if (glsurf != null) {
glsurf.onPause();
}
}
@Override
public void onResume() {
super.onResume();
if (glsurf != null)
glsurf.onResume(); …Run Code Online (Sandbox Code Playgroud)