V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
over140
V2EX  ›  Android

Android 使用 TextureView 遇到的问题

  •  
  •   over140 · 2014-05-13 11:24:30 +08:00 · 22917 次点击
    这是一个创建于 3859 天前的主题,其中的信息可能已经有所发展或是发生改变。
    捕获到的log如下:
    java.lang.RuntimeException: Error during detachFromGLContext (see logcat for details)
    at android.graphics.SurfaceTexture.detachFromGLContext(SurfaceTexture.java:217)
    at android.view.TextureView.destroySurface(TextureView.java:226)
    at android.view.TextureView.destroyHardwareResources(TextureView.java:336)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1670)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.destroyResources(HardwareRenderer.java:1677)
    at android.view.HardwareRenderer$Gl20Renderer.access$600(HardwareRenderer.java:1425)
    at android.view.HardwareRenderer$Gl20Renderer$2.run(HardwareRenderer.java:1662)
    at android.view.HardwareRenderer$Gl20Renderer.safelyRun(HardwareRenderer.java:1605)
    at android.view.HardwareRenderer$Gl20Renderer.destroyHardwareResources(HardwareRenderer.java:1652)
    at android.view.ViewRootImpl.terminateHardwareResources(ViewRootImpl.java:741)
    at android.view.WindowManagerGlobal.startTrimMemory(WindowManagerGlobal.java:403)
    at android.app.ActivityThread.handleTrimMemory(ActivityThread.java:4310)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1532)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:153)
    at android.app.ActivityThread.main(ActivityThread.java:5331)
    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:842)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
    at dalvik.system.NativeStart.main(Native Method)

    ~~~~
    补充说明:
    1、有查到说TextureView所在的Activity需要设置android:hardwareAccelerated="true",现在全都设置了还是会报错。
    2、从统计数据来看只有三星的设备不会报这个错误,HUAWEI、OPPO、vivo、Coolpad、红米、索尼S39h这些设备会出错
    3、这个错误并不是毕现。


    又遇到同样问题的同学还请分享一下经验^ ^

    ~~~~
    额外发个招小伙伴的帖子:
    http://www.neitui.me/j/69648
    2 条回复    2018-11-13 17:16:07 +08:00
    xiaojiaqiao
        1
    xiaojiaqiao  
       2016-01-07 10:09:55 +08:00
    同遇到,请问解决了没有
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3662 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 04:19 · PVG 12:19 · LAX 20:19 · JFK 23:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.