I have an application on Google Play for counting down numbers and letters. In this application I have the following activities:
我在Google Play上有一个应用程序,用于倒计时数字和字母。在这个应用程序中,我有以下活动:
- 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:
我使用Google Analytics和ACRA进行错误报告。我不使用GLsurfaceView,但我每天使用一次或两次ACRA,这给了我这些错误:
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?
有谁知道发生了什么?我不使用surfaceView;谁能帮我?
2 个解决方案
#1
7
I had the same issue and found that the problem is related to WebView(s) and hardware acceleration on some devices.
我遇到了同样的问题,发现问题与某些设备上的WebView和硬件加速有关。
Instead of turning off completely hardware acceleration, I disabled it for all my WebView(s) including the AdMob view!
我没有关闭完全硬件加速,而是为所有我的WebView(包括AdMob视图)禁用了它!
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
}
#2
2
Have you tried disabling hardware acceleration for your app (it's utilizing OpenGL hence the hunch for this fix)?
你有没有尝试过为你的应用程序禁用硬件加速(它正在利用OpenGL,因此这个修复的预感)?
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
如果您想知道,请查看此问题及答案:是否应使用硬件加速
#1
7
I had the same issue and found that the problem is related to WebView(s) and hardware acceleration on some devices.
我遇到了同样的问题,发现问题与某些设备上的WebView和硬件加速有关。
Instead of turning off completely hardware acceleration, I disabled it for all my WebView(s) including the AdMob view!
我没有关闭完全硬件加速,而是为所有我的WebView(包括AdMob视图)禁用了它!
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
}
#2
2
Have you tried disabling hardware acceleration for your app (it's utilizing OpenGL hence the hunch for this fix)?
你有没有尝试过为你的应用程序禁用硬件加速(它正在利用OpenGL,因此这个修复的预感)?
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
如果您想知道,请查看此问题及答案:是否应使用硬件加速