29

I have an application on Google Play for counting down numbers and letters. In this application I have the following activities:

  • google sigin
  • archivements
  • admob service

I use Google Analytics, and ACRA for error reporting. I don't use GLsurfaceView, but I use ACRA one or two times a day which gives me these errors:

java.lang.RuntimeException: createWindowSurface failed EGL_BAD_ALLOC
at android.view.HardwareRenderer$GlRenderer.createSurface(HardwareRenderer.java:763)
at android.view.HardwareRenderer$GlRenderer.createEglSurface(HardwareRenderer.java:663)
at android.view.HardwareRenderer$GlRenderer.initialize(HardwareRenderer.java:502)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1325)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2467)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

Does anyone know what happened? I don't use surfaceView; can anyone help me?

TofferJ
  • 4,678
  • 1
  • 37
  • 49
cayrodev
  • 373
  • 1
  • 4
  • 8
  • 1
    Got it fixed ? I think its because of admob – xmen Dec 17 '13 at 14:38
  • Are you using images as activity's background? Devices have a maximum resolution of the images that can manage (it differs depending of the devices), if you are trying to create and use an image larger than that resolution, you'll get a GL Error. – PoOk Jan 08 '14 at 14:56
  • Maybe its for admob, what can i do? i have images on background, but it weight is 80kb... – cayrodev Jan 10 '14 at 14:53
  • Same problem, few observations about this exception: 1. Android 4.0 & 4.1, 2. Tablets, 3. GPU: Mali 400, 4. Not found on Samsung devices. – sagis Apr 27 '14 at 06:02
  • I saw this today working on a custom animated transition. I'm seeing it on a Note3 on stock 4.4.2. Not seeing it on a Moto G on 4.4.2 or Nexus 5 on 5.0 (LPX13D). It's consistent on the Note3. Pretty complex animation moving four variables using ObjectAnimator on a few different objects. I have two workarounds so far... 1) reduce complexity of animation. 2.) add a black background behind the animating views (technically there is no background behind the transitioning views in the interest of of reducing overdraw). These workarounds aren't terribly scientific/could be coincidence. – tliebeck Oct 29 '14 at 08:09

2 Answers2

8

I had the same issue and found that the problem is related to WebView(s) and hardware acceleration on some devices.

Instead of turning off completely hardware acceleration, I disabled it for all my WebView(s) including the AdMob view!

Here how to do it:

adView = new AdView(this); //or get it with findViewById()
if (Build.VERSION.SDK_INT >= 11) {
   adView.setLayerType(AdView.LAYER_TYPE_SOFTWARE, null); //instead of LAYER_TYPE_HARDWARE
}
agirardello
  • 2,895
  • 22
  • 22
2

Have you tried disabling hardware acceleration for your app (it's utilizing OpenGL hence the hunch for this fix)?

Adding

<application android:hardwareAccelerated="false" ...>

To application tag in the manifest would explicitly turn it off. And perhaps the issue will go away.

See this question with answers if you want to know: if should use hardware acceleration or not

Community
  • 1
  • 1
Magnus
  • 1,483
  • 11
  • 14