I get EGL error: EGL_BAD_ALLOC in my app after Nexus 10 update to Android 4.4. It causes hardware acceleration to go off and later to block application completely because of following errors.
To cause error I play with fragment containing Google Maps Android API v2 and then switch to HorizontalVariableListView (https://github.com/sephiroth74/HorizontalVariableListView). Sometimes scrolling it causes this error.
Any suggestions? This error occurs both when my app hes android:targetSdkVersion="18" and android:targetSdkVersion="19"
11-27 14:02:02.515: W/HardwareRenderer(15033): EGL error: EGL_BAD_ALLOC
11-27 14:02:02.530: W/HardwareRenderer(15033): Mountain View, we've had a problem here. Switching back to software rendering.
(..)
11-27 14:02:02.995: E/gralloc(15033): invalid gralloc handle (at 0x0)
11-27 14:02:02.995: W/GraphicBufferMapper(15033): lock(...) failed -22 (Invalid argument)
11-27 14:02:02.995: W/Surface(15033): failed locking buffer (handle = 0x0)
11-27 14:02:02.995: E/ViewRootImpl(15033): Could not lock surface
11-27 14:02:02.995: E/ViewRootImpl(15033): java.lang.IllegalArgumentException
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.Surface.nativeLockCanvas(Native Method)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.Surface.lockCanvas(Surface.java:243)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2433)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2407)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2251)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1881)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5582)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.Choreographer.doFrame(Choreographer.java:532)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.os.Handler.handleCallback(Handler.java:733)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.os.Handler.dispatchMessage(Handler.java:95)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.os.Looper.loop(Looper.java:137)
11-27 14:02:02.995: E/ViewRootImpl(15033): at android.app.ActivityThread.main(ActivityThread.java:4998)
11-27 14:02:02.995: E/ViewRootImpl(15033): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 14:02:02.995: E/ViewRootImpl(15033): at java.lang.reflect.Method.invoke(Method.java:515)
11-27 14:02:02.995: E/ViewRootImpl(15033): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
11-27 14:02:02.995: E/ViewRootImpl(15033): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
11-27 14:02:02.995: E/ViewRootImpl(15033): at dalvik.system.NativeStart.main(Native Method)
It seems that this error was caused by to many opened files in map view. This error was later causing hw acceleration error. Now I load cached images from LruCache instead of files only and the error disappeared.