We are unexpectedly experiencing a large amount of crashes, around 3000-7000 crashes daily. This number is split across multiple different stack traces we see in the Google Play Console, but all of them fail with similar messages:
No pending exception expected: java.lang.IllegalStateException: Unable to create layer for LinearLayout, size 256x-64 max size 16384 color type 4 has context 1
From what we see the Android rendering stack is trying to render a view with a negative or 0 dimension. In the majority cases we see a LinearLayout, but there are cases with other ViewGroups as well. We don’t control these directly but instead rely on Androids ConstraintLayout and leverage the Android transition animation system, which we believe calculates these negative / zero view sizes.
We have a deep view hierarchy with a ConstraintLayout with the animateLayoutChanges="true" at the root level. As a temporary workaround we have disabled animations as does decrease the crashes in some cases, but doesn't eliminate them all. We suspect that we hit similar issues lower in the view hierarchy, and we're trying to identify the views that could potentially cause the issue. Currently we have one scenario where we can reproduce the issue but can not yet identify the views that cause trouble rendering the layouts yet. Is there an easy way to identify these views, to put more limited workarounds in place?
We suspect there is a bug in the underlying calculation of these dimensions in the ConstraingLayout or transition system which results in the negative or zero view sizes.
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
backtrace:
#00 pc 0x0000000000094264 /apex/com.android.runtime/lib64/bionic/libc.so (abort+164)
#01 pc 0x0000000000771c60 /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+904)
#02 pc 0x00000000000357d0 /apex/com.android.art/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_0::__invoke(char const*)+80)
#03 pc 0x0000000000034d58 /apex/com.android.art/lib64/libbase.so (android::base::LogMessage::~LogMessage()+352)
#04 pc 0x000000000025ae28 /apex/com.android.art/lib64/libart.so (art::ClassLinker::FindClass(art::Thread*, char const*, art::Handle<art::mirror::ClassLoader>)+8988)
#05 pc 0x00000000002dd214 /apex/com.android.art/lib64/libart.so (art::ClassLinker::ResolveField(unsigned int, art::Handle<art::mirror::DexCache>, art::Handle<art::mirror::ClassLoader>, bool)+460)
#06 pc 0x00000000002d71d8 /apex/com.android.art/lib64/libart.so (art::ResolveFieldWithAccessChecks(art::Thread*, art::ClassLinker*, unsigned short, art::ArtMethod*, bool, bool, unsigned long)+9152)
#07 pc 0x00000000002d4dac /apex/com.android.art/lib64/libart.so (NterpGetInstanceFieldOffset+112)
#08 pc 0x00000000005c0670 /apex/com.android.art/lib64/libart.so (nterp_get_instance_field_offset+48)
#09 pc 0x00000000005b9e84 /apex/com.android.art/lib64/libart.so (nterp_op_iget_object_slow_path+20)
#10 pc 0x00000000001f6f88 /system/framework/framework.jar (android.view.ViewRootImpl$8$$ExternalSyntheticLambda0.accept)
#11 pc 0x000000000033eba4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
#12 pc 0x000000000033cc28 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+772)
#13 pc 0x0000000000562c9c /apex/com.android.art/lib64/libart.so (art::JNI<false>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+192)
#14 pc 0x00000000000df728 /system/lib64/libandroid_runtime.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+120)
#15 pc 0x00000000001739ac /system/lib64/libandroid_runtime.so (std::__1::__function::__func<android::nativeSyncNextTransaction(_JNIEnv*, _jclass*, long, _jobject*, unsigned char)::$_0, std::__1::allocator<android::nativeSyncNextTransaction(_JNIEnv*, _jclass*, long, _jobject*, unsigned char)::$_0>, void (android::SurfaceComposerClient::Transaction*)>::operator()(android::SurfaceComposerClient::Transaction*&&)+188)
#16 pc 0x00000000000b691c /system/lib64/libgui.so (android::BLASTBufferQueue::onFrameAvailable(android::BufferItem const&)+3212)
#17 pc 0x00000000000c3f3c /system/lib64/libgui.so (android::ConsumerBase::onFrameAvailable(android::BufferItem const&)+172)
#18 pc 0x0000000000091068 /system/lib64/libgui.so (android::BufferQueue::ProxyConsumerListener::onFrameAvailable(android::BufferItem const&)+104)
#19 pc 0x000000000009c6fc /system/lib64/libgui.so (android::BufferQueueProducer::queueBuffer(int, android::IGraphicBufferProducer::QueueBufferInput const&, android::IGraphicBufferProducer::QueueBufferOutput*)+3164)
#20 pc 0x00000000000fe4b8 /system/lib64/libgui.so (android::Surface::queueBuffer(ANativeWindowBuffer*, int)+1272)
#21 pc 0x00000000000f962c /system/lib64/libgui.so (android::Surface::hook_queueBuffer(ANativeWindow*, ANativeWindowBuffer*, int)+92)
#22 pc 0x000000000077ce10 /vendor/lib64/egl/mt6893/libGLES_mali.so
#23 pc 0x000000000079264c /vendor/lib64/egl/mt6893/libGLES_mali.so
#24 pc 0x000000000079170c /vendor/lib64/egl/mt6893/libGLES_mali.so
#25 pc 0x0000000000022d54 /system/lib64/libEGL.so (android::eglSwapBuffersWithDamageKHRImpl(void*, void*, int*, int)+468)
#26 pc 0x000000000001f598 /system/lib64/libEGL.so (eglSwapBuffersWithDamageKHR+72)
#27 pc 0x00000000002d5b18 /system/lib64/libhwui.so (android::uirenderer::renderthread::EglManager::swapBuffers(android::uirenderer::renderthread::Frame const&, SkRect const&)+104)
#28 pc 0x00000000002c80c4 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::swapBuffers(android::uirenderer::renderthread::Frame const&, bool, SkRect const&, android::uirenderer::FrameInfo*, bool*)+132)
#29 pc 0x00000000002d0b40 /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw(bool)+1648)
#30 pc 0x00000000002d3be0 /system/lib64/libhwui.so (std::__1::__function::__func<android::uirenderer::renderthread::DrawFrameTask::postAndWait()::$_0, std::__1::allocator<android::uirenderer::renderthread::DrawFrameTask::postAndWait()::$_0>, void ()>::operator()() (.__uniq.264041412789356548918088680803242235290.3c9219c4c61f046e2a02e26efbc92a9c)+1344)
#31 pc 0x00000000002c1c40 /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+624)
#32 pc 0x00000000002e5f04 /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+404)
#33 pc 0x000000000001430c /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+284)
#34 pc 0x0000000000101d5c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204)
#35 pc 0x0000000000095bc0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
backtrace:
#00 pc 0x0000000000059b38 /apex/com.android.runtime/lib64/bionic/libc.so (abort+164)
#01 pc 0x0000000000771ae0 /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+904)
#02 pc 0x00000000000357d0 /apex/com.android.art/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_0::__invoke(char const*)+80)
#03 pc 0x0000000000034d58 /apex/com.android.art/lib64/libbase.so (android::base::LogMessage::~LogMessage()+352)
#04 pc 0x000000000025ae28 /apex/com.android.art/lib64/libart.so (art::ClassLinker::FindClass(art::Thread*, char const*, art::Handle<art::mirror::ClassLoader>)+8988)
#05 pc 0x00000000002dd214 /apex/com.android.art/lib64/libart.so (art::ClassLinker::ResolveField(unsigned int, art::Handle<art::mirror::DexCache>, art::Handle<art::mirror::ClassLoader>, bool)+460)
#06 pc 0x00000000002d71d8 /apex/com.android.art/lib64/libart.so (art::ResolveFieldWithAccessChecks(art::Thread*, art::ClassLinker*, unsigned short, art::ArtMethod*, bool, bool, unsigned long)+9152)
#07 pc 0x00000000002d4dac /apex/com.android.art/lib64/libart.so (NterpGetInstanceFieldOffset+112)
#08 pc 0x00000000005c0670 /apex/com.android.art/lib64/libart.so (nterp_get_instance_field_offset+48)
#09 pc 0x00000000005b9e84 /apex/com.android.art/lib64/libart.so (nterp_op_iget_object_slow_path+20)
#10 pc 0x000000000023fc74 /system/framework/framework.jar (android.view.ViewRootImpl$8$$ExternalSyntheticLambda0.accept)
#11 pc 0x000000000033eba4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
#12 pc 0x000000000033cc28 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+772)
#13 pc 0x0000000000562cbc /apex/com.android.art/lib64/libart.so (art::JNI<false>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+192)
#14 pc 0x00000000000dd5bc /system/lib64/libandroid_runtime.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+120)
#15 pc 0x000000000016aad0 /system/lib64/libandroid_runtime.so (std::__1::__function::__func<android::nativeSyncNextTransaction(_JNIEnv*, _jclass*, long, _jobject*, unsigned char)::$_0, std::__1::allocator<android::nativeSyncNextTransaction(_JNIEnv*, _jclass*, long, _jobject*, unsigned char)::$_0>, void (android::SurfaceComposerClient::Transaction*)>::operator()(android::SurfaceComposerClient::Transaction*&&)+188)
#16 pc 0x00000000000b15e0 /system/lib64/libgui.so (android::BLASTBufferQueue::onFrameAvailable(android::BufferItem const&)+2364)
#17 pc 0x00000000000bd220 /system/lib64/libgui.so (android::ConsumerBase::onFrameAvailable(android::BufferItem const&)+172)
#18 pc 0x000000000008e880 /system/lib64/libgui.so (android::BufferQueue::ProxyConsumerListener::onFrameAvailable(android::BufferItem const&)+104)
#19 pc 0x00000000000998b0 /system/lib64/libgui.so (android::BufferQueueProducer::queueBuffer(int, android::IGraphicBufferProducer::QueueBufferInput const&, android::IGraphicBufferProducer::QueueBufferOutput*)+2924)
#20 pc 0x00000000000ef02c /system/lib64/libgui.so (android::Surface::queueBuffer(ANativeWindowBuffer*, int)+592)
#21 pc 0x00000000000eb388 /system/lib64/libgui.so (android::Surface::hook_queueBuffer(ANativeWindow*, ANativeWindowBuffer*, int)+92)
#22 pc 0x00000000008554ac /vendor/lib64/egl/libGLES_mali.so (display_window_buffer(egl_winsys_display*, egl_winsys_surface*, egl_color_buffer*, int, int*)+236)
#23 pc 0x000000000086e1d4 /vendor/lib64/egl/libGLES_mali.so (eglp_gles_flush_operation+1732)
#24 pc 0x000000000086d224 /vendor/lib64/egl/libGLES_mali.so (eglp_swap_buffers+596)
#25 pc 0x000000000086d338 /vendor/lib64/egl/libGLES_mali.so (eglSwapBuffersWithDamageKHR+8)
#26 pc 0x000000000003161c /system/lib64/libEGL.so (android::eglSwapBuffersWithDamageKHRImpl(void*, void*, int*, int)+576)
#27 pc 0x000000000002de5c /system/lib64/libEGL.so (eglSwapBuffersWithDamageKHR+72)
#28 pc 0x0000000000538144 /system/lib64/libhwui.so (android::uirenderer::renderthread::EglManager::swapBuffers(android::uirenderer::renderthread::Frame const&, SkRect const&)+104)
#29 pc 0x000000000052b0f4 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::swapBuffers(android::uirenderer::renderthread::Frame const&, bool, SkRect const&, android::uirenderer::FrameInfo*, bool*)+128)
#30 pc 0x00000000005336b4 /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw(bool)+1244)
#31 pc 0x00000000005363d4 /system/lib64/libhwui.so (std::__1::__function::__func<android::uirenderer::renderthread::DrawFrameTask::postAndWait()::$_0, std::__1::allocator<android::uirenderer::renderthread::DrawFrameTask::postAndWait()::$_0>, void ()>::operator()() (.__uniq.264041412789356548918088680803242235290.c303f2d2360db58ed70a2d0ac7ed911b)+1320)
#32 pc 0x00000000005253d8 /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+600)
#33 pc 0x00000000005472a4 /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+404)
#34 pc 0x0000000000013dd8 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+284)
#35 pc 0x00000000000be888 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208)
#36 pc 0x000000000005b370 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
backtrace:
#00 pc 0x000000000007caa4 /apex/com.android.runtime/lib64/bionic/libc.so (abort+180)
#01 pc 0x0000000000771c60 /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+904)
#02 pc 0x00000000000357d0 /apex/com.android.art/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_0::__invoke(char const*)+80)
#03 pc 0x0000000000034d58 /apex/com.android.art/lib64/libbase.so (android::base::LogMessage::~LogMessage()+352)
#04 pc 0x0000000000359cf0 /apex/com.android.art/lib64/libart.so (artStringBuilderAppend+1840)
#05 pc 0x0000000000355a58 /apex/com.android.art/lib64/libart.so (art_quick_string_builder_append+56)
#06 pc 0x0000000000e95230 /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.view.ViewRootImpl$8.lambda$onFrameDraw$0$android-view-ViewRootImpl$8+160)
#07 pc 0x0000000000e60164 /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.view.ThreadedRenderer$1$$ExternalSyntheticLambda0.onFrameCommit+420)
#08 pc 0x000000000033eba4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
#09 pc 0x000000000033cc28 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+772)
#10 pc 0x0000000000562c9c /apex/com.android.art/lib64/libart.so (art::JNI<false>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+192)
#11 pc 0x000000000020d2f8 /system/lib64/libhwui.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+120)
#12 pc 0x000000000026ff9c /system/lib64/libhwui.so (android::FrameCommitWrapper::onFrameCommit(bool)+268)
#13 pc 0x0000000000287900 /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+1840)
#14 pc 0x000000000028a1cc /system/lib64/libhwui.so (std::__1::__function::__func<android::uirenderer::renderthread::DrawFrameTask::postAndWait()::$_0, std::__1::allocator<android::uirenderer::renderthread::DrawFrameTask::postAndWait()::$_0>, void ()>::operator()() (.c1671e787f244890c877724752face20)+908)
#15 pc 0x0000000000278afc /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+588)
#16 pc 0x000000000029ac38 /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+424)
#17 pc 0x0000000000013550 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+416)
#18 pc 0x00000000000eb720 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208)
#19 pc 0x000000000007e2d0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
backtrace:
#00 pc 0x00000000000950b0 /apex/com.android.runtime/lib64/bionic/libc.so (abort+168)
#01 pc 0x00000000007716f0 /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+904)
#02 pc 0x00000000000357d0 /apex/com.google.mainline.primary.libs@341050000/lib64/libbase.so/75d3253827fcfd7a8d7b02ad45991611ec4ca424c0278e13e8acfad4d14e597a3ecff6c0caa2b785c73838528ee6e9c2b313240ff895f50ee39b1d7bc10f390a/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_0::__invoke(char const*)+80)
#03 pc 0x0000000000034d58 /apex/com.google.mainline.primary.libs@341050000/lib64/libbase.so/75d3253827fcfd7a8d7b02ad45991611ec4ca424c0278e13e8acfad4d14e597a3ecff6c0caa2b785c73838528ee6e9c2b313240ff895f50ee39b1d7bc10f390a/libbase.so (android::base::LogMessage::~LogMessage()+352)
#04 pc 0x000000000025c8bc /apex/com.android.art/lib64/libart.so (art::ClassLinker::FindClass(art::Thread*, char const*, art::Handle<art::mirror::ClassLoader>)+10444)
#05 pc 0x00000000002d60e0 /apex/com.android.art/lib64/libart.so (art::ClassLinker::ResolveField(unsigned int, art::Handle<art::mirror::DexCache>, art::Handle<art::mirror::ClassLoader>, bool)+460)
#06 pc 0x00000000002cf860 /apex/com.android.art/lib64/libart.so (art::ResolveFieldWithAccessChecks(art::Thread*, art::ClassLinker*, unsigned short, art::ArtMethod*, bool, bool, unsigned long)+7648)
#07 pc 0x00000000002cda14 /apex/com.android.art/lib64/libart.so (NterpGetInstanceFieldOffset+112)
#08 pc 0x00000000005c1cf0 /apex/com.android.art/lib64/libart.so (nterp_get_instance_field_offset+48)
#09 pc 0x00000000005bb504 /apex/com.android.art/lib64/libart.so (nterp_op_iget_object_slow_path+20)
#10 pc 0x000000000023fc20 /system/framework/framework.jar (android.view.ViewRootImpl$8$$ExternalSyntheticLambda0.accept)
#11 pc 0x0000000000333fa4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
#12 pc 0x0000000000332020 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+772)
#13 pc 0x0000000000566768 /apex/com.android.art/lib64/libart.so (art::JNI<false>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+192)
#14 pc 0x00000000000e2618 /system/lib64/libandroid_runtime.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+124)
#15 pc 0x0000000000175528 /system/lib64/libandroid_runtime.so (std::__1::__function::__func<android::nativeSyncNextTransaction(_JNIEnv*, _jclass*, long, _jobject*, unsigned char)::$_0, std::__1::allocator<android::nativeSyncNextTransaction(_JNIEnv*, _jclass*, long, _jobject*, unsigned char)::$_0>, void (android::SurfaceComposerClient::Transaction*)>::operator()(android::SurfaceComposerClient::Transaction*&&)+192)
#16 pc 0x00000000000bb4b8 /system/lib64/libgui.so (android::BLASTBufferQueue::onFrameAvailable(android::BufferItem const&)+2368)
#17 pc 0x00000000000c78fc /system/lib64/libgui.so (android::ConsumerBase::onFrameAvailable(android::BufferItem const&)+176)
#18 pc 0x0000000000097bc8 /system/lib64/libgui.so (android::BufferQueue::ProxyConsumerListener::onFrameAvailable(android::BufferItem const&)+108)
#19 pc 0x00000000000a2f28 /system/lib64/libgui.so (android::BufferQueueProducer::queueBuffer(int, android::IGraphicBufferProducer::QueueBufferInput const&, android::IGraphicBufferProducer::QueueBufferOutput*)+2920)
#20 pc 0x00000000000fb500 /system/lib64/libgui.so (android::Surface::queueBuffer(ANativeWindowBuffer*, int)+600)
#21 pc 0x00000000000f7704 /system/lib64/libgui.so (android::Surface::hook_queueBuffer(ANativeWindow*, ANativeWindowBuffer*, int)+96)
#22 pc 0x000000000000f810 /vendor/lib64/egl/eglSubDriverAndroid.so
#23 pc 0x00000000002db4d8 /vendor/lib64/egl/libGLESv2_adreno.so (!!!0000!10f39af3d5dda97a64124dee6a3783!7b26bdd942!+216)
#24 pc 0x0000000000362e84 /vendor/lib64/egl/libGLESv2_adreno.so (!!!0000!04fe7c7713a0660472688458ecb7a2!7b26bdd942!+148)
#25 pc 0x0000000000032e00 /system/lib64/libEGL.so (android::eglSwapBuffersWithDamageKHRImpl(void*, void*, int*, int)+632)
#26 pc 0x000000000002f2f8 /system/lib64/libEGL.so (eglSwapBuffersWithDamageKHR+76)
#27 pc 0x000000000053cf1c /system/lib64/libhwui.so (android::uirenderer::renderthread::EglManager::swapBuffers(android::uirenderer::renderthread::Frame const&, SkRect const&)+108)
#28 pc 0x000000000052f814 /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::swapBuffers(android::uirenderer::renderthread::Frame const&, bool, SkRect const&, android::uirenderer::FrameInfo*, bool*)+132)
#29 pc 0x000000000053829c /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw(bool)+1248)
#30 pc 0x000000000053b128 /system/lib64/libhwui.so (std::__1::__function::__func<android::uirenderer::renderthread::DrawFrameTask::postAndWait()::$_0, std::__1::allocator<android::uirenderer::renderthread::DrawFrameTask::postAndWait()::$_0>, void ()>::operator()() (.__uniq.264041412789356548918088680803242235290.c303f2d2360db58ed70a2d0ac7ed911b)+1324)
#31 pc 0x00000000005298e8 /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+608)
#32 pc 0x000000000054c8dc /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+408)
#33 pc 0x00000000000142d4 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+288)
#34 pc 0x00000000000fd0f4 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208)
#35 pc 0x0000000000096a04 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68)
Collapse
Description
We are unexpectedly experiencing a large amount of crashes, around 3000-7000 crashes daily. This number is split across multiple different stack traces we see in the Google Play Console, but all of them fail with similar messages:
No pending exception expected: java.lang.IllegalStateException: Unable to create layer for LinearLayout, size 256x-64 max size 16384 color type 4 has context 1
From what we see the Android rendering stack is trying to render a view with a negative or 0 dimension. In the majority cases we see a LinearLayout, but there are cases with other ViewGroups as well. We don’t control these directly but instead rely on Androids ConstraintLayout and leverage the Android transition animation system, which we believe calculates these negative / zero view sizes.
We have a deep view hierarchy with a ConstraintLayout with the animateLayoutChanges="true" at the root level. As a temporary workaround we have disabled animations as does decrease the crashes in some cases, but doesn't eliminate them all. We suspect that we hit similar issues lower in the view hierarchy, and we're trying to identify the views that could potentially cause the issue. Currently we have one scenario where we can reproduce the issue but can not yet identify the views that cause trouble rendering the layouts yet. Is there an easy way to identify these views, to put more limited workarounds in place?
We suspect there is a bug in the underlying calculation of these dimensions in the ConstraingLayout or transition system which results in the negative or zero view sizes.