在Nexus 10更新到Android 4.4之后,我的应用中出现了EGL错误:EGL_BAD_ALLOC。由于以下错误,它会导致硬件加速关闭,然后完全阻止应用程序。
导致错误我使用包含Google Maps Android API v2的片段,然后切换到HorizontalVariableListView(https://github.com/sephiroth74/HorizontalVariableListView)。有时滚动会导致此错误。
有什么建议吗?这个错误发生在我的应用程序他的android:targetSdkVersion =“18”和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)
答案 0 :(得分:1)
似乎此错误是由地图视图中的许多已打开文件引起的。此错误后来导致hw加速错误。现在我从LruCache加载缓存的图像而不是文件,错误消失了。