Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IllegalStateException on HardwareRenderer createSurface

Tags:

android

In my crashlytics logs I see following error:

java.lang.IllegalStateException eglMakeCurrent failed EGL_BAD_ALLOC  android.view.HardwareRenderer GlRenderer.createSurface HardwareRenderer.java
       at android.view.HardwareRenderer$GlRenderer.invalidate(HardwareRenderer.java:1328)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1921)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1234)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6467)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
       at android.view.Choreographer.doCallbacks(Choreographer.java:603)
       at android.view.Choreographer.doFrame(Choreographer.java:573)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
       at android.os.Handler.handleCallback(Handler.java:733)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:157)
       at android.app.ActivityThread.main(ActivityThread.java:5356)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
       at dalvik.system.NativeStart.main(NativeStart.java)

https://github.com/android/platform_frameworks_base/blob/android-4.4_r1.2/core/java/android/view/HardwareRenderer.java#L1328

I get this crash for GT I9500 - Android 4.4.2 users. What would be the cause and how can I isolate the problem ?

(Similar: Problems with passing variable via intent between activities eglSwapBuffers failed: EGL_BAD_ALLOC AndEngine Android)

like image 202
trante Avatar asked May 22 '14 16:05

trante


2 Answers

Like the link you mentioned says, First place to look for errors is to ensure that onPause and onResume are passed to both your super and to the GLSurfaceView

...@Override
    protected void onPause() {
        super.onPause();
        mGLView.onPause();
    }

    @Override
    protected void onResume() {
        super.onResume();
        mGLView.onResume();
    }

    private GLSurfaceView mGLView;...
like image 57
Vrashabh Irde Avatar answered Sep 29 '22 10:09

Vrashabh Irde


The following code (for hiding the navigation bar) produces also a EGL_BAD_ALLOC on some devices (in my case a Samsung Galaxy Tab 10.1 with Android 4.2.2):

Window window = getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.flags |= 0x80000000;
window.setAttributes(attributes);
like image 25
Raimund Wege Avatar answered Sep 29 '22 11:09

Raimund Wege