我在Android模拟器MacOsX上有奇怪的错误。这个Android应用程序在真实设备上运行良好。我一直在谷歌搜索它,但很少有关于它的线程讨论。我刚刚使用基本相对布局开发了片段。当我运行它时,我得到这些错误
08-09 10:07:00.973 4271-4466 / com.xxx.xxx E / OpenGLRenderer:GL错误:0x506
08-09 10:07:00.973 4271-4466 / com.xxx.xxx A / OpenGLRenderer:GL错误!框架/碱/库/慧深/ BakedOpRenderer.cpp:98
08-09 10:07:00.973 4271-4466 / com.xxx.xxx A / libc:致命信号6(SIGABRT),tid 4466中的代码-6(RenderThread)
[08-09 10:07:00.974 1261:1261 W /] debuggerd:处理请求:pid = 4271 uid = 10085 gid = 10085 tid = 4466
是否有调试它以显示更多错误详细信息或修复此错误?此错误会导致应用崩溃。
答案 0 :(得分:2)
这还不是一个很好的答案,但我发帖是为了帮助他们找到答案。
所以,我只是在我的Pixel XL上点击这个,并查看来源,我们正在打击"断言"在BakedOpRenderer.cpp中:
void BakedOpRenderer::endLayer() {
if (mRenderTarget.stencil) {
// if stencil was used for clipping, detach it and return it to pool
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
GL_CHECKPOINT(MODERATE);
mCaches.renderBufferCache.put(mRenderTarget.stencil);
mRenderTarget.stencil = nullptr;
}
mRenderTarget.lastStencilClip = nullptr;
mRenderTarget.offscreenBuffer->updateMeshFromRegion();
mRenderTarget.offscreenBuffer = nullptr; // It's in drawLayerOp's hands now.
// Detach the texture from the FBO
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
GL_CHECKPOINT(LOW);
mRenderState.deleteFramebuffer(mRenderTarget.frameBufferId);
mRenderTarget.frameBufferId = 0;
}
我们正在点击GL_CHECKPOINT(LOW)
区块。
#if DEBUG_OPENGL
#define GL_CHECKPOINT(LEVEL) \
do { if (DEBUG_OPENGL >= DEBUG_LEVEL_##LEVEL) {\
LOG_ALWAYS_FATAL_IF(android::uirenderer::GLUtils::dumpGLErrors(),\
"GL errors! %s:%d", __FILE__, __LINE__);\
} } while (0)
#else
#define GL_CHECKPOINT(LEVEL)
#endif
(DEBUG_OPENGL
似乎默认为DEBUG_LEVEL_LOW
)
实际完成工作的函数dumpGLErrors是defined in GLUtils.cpp,如下:
bool GLUtils::dumpGLErrors() {
#if DEBUG_OPENGL >= DEBUG_LEVEL_HIGH
// If DEBUG_LEVEL_HIGH is set then every GLES call is already wrapped
// and asserts that there was no error. So this can just return success.
return false;
#else
bool errorObserved = false;
GLenum status = GL_NO_ERROR;
while ((status = glGetError()) != GL_NO_ERROR) {
errorObserved = true;
switch (status) {
case GL_INVALID_ENUM:
ALOGE("GL error: GL_INVALID_ENUM");
break;
case GL_INVALID_VALUE:
ALOGE("GL error: GL_INVALID_VALUE");
break;
case GL_INVALID_OPERATION:
ALOGE("GL error: GL_INVALID_OPERATION");
break;
case GL_OUT_OF_MEMORY:
ALOGE("GL error: Out of memory!");
break;
default:
ALOGE("GL error: 0x%x", status);
}
}
return errorObserved;
#endif
}
在这里,我的问题很奇怪。您的日志中有GL error: 0x506
行,但我不知道。
您的错误是an GL_INVALID_FRAMEBUFFER_OPERATION
错误,看起来像you need to look into that。
但是,如果您想获得更多信息,则需要使用DEBUG_LEVEL_HIGH
和other options之类的内容重新编译Android hwui库。
在我这边,我不知道,因为铬的崩溃并没有留下" GL错误"在logcat
。 GRR。