Android-Surface::lock failed

0 投票
Android系统版本4.1.1
地图不展示,地图相关数据也不展示,应该是工作空间打开异常了。
如果不是SDK问题,请问有哪些可能导致这个错误?

错误日志如下:

08-27 11:46:55.307 7026-7026/? E/SurfaceTextureClient: Surface::lock failed, already locked
08-27 11:46:55.315 7026-7026/? E/SurfaceHolder: Exception locking surface
    java.lang.IllegalArgumentException
        at android.view.Surface.lockCanvasNative(Native Method)
        at android.view.Surface.lockCanvas(Surface.java:88)
        at android.view.SurfaceView$4.internalLockCanvas(SurfaceView.java:754)
        at android.view.SurfaceView$4.lockCanvas(SurfaceView.java:730)
        at com.supermap.mapping.MapControl1.c(MapControl1.java:332)
        at com.supermap.mapping.MapControl1.refreshCallback(MapControl1.java:1027)
        at com.supermap.mapping.MapControlNative.jni_SetSize(Native Method)
        at com.supermap.mapping.MapControl1.a(MapControl1.java:1173)
        at com.supermap.mapping.MapControl1.c(MapControl1.java:342)
        at com.supermap.mapping.MapControl1$3.surfaceCreated(MapControl1.java:305)
        at android.view.SurfaceView.updateWindow(SurfaceView.java:543)
        at android.view.SurfaceView.access$000(SurfaceView.java:81)
        at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:169)
        at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:671)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1818)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
        at android.view.Choreographer.doCallbacks(Choreographer.java:555)
        at android.view.Choreographer.doFrame(Choreographer.java:525)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
        at android.os.Handler.handleCallback(Handler.java:615)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        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:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)
08-27 11:46:55.323 7026-7026/? E/SurfaceTextureClient: Surface::lock failed, already locked
08-27 11:46:55.331 7026-7026/? E/SurfaceHolder: Exception locking surface
    java.lang.IllegalArgumentException
        at android.view.Surface.lockCanvasNative(Native Method)
        at android.view.Surface.lockCanvas(Surface.java:88)
        at android.view.SurfaceView$4.internalLockCanvas(SurfaceView.java:754)
        at android.view.SurfaceView$4.lockCanvas(SurfaceView.java:730)
        at com.supermap.mapping.MapControl1.c(MapControl1.java:332)
        at com.supermap.mapping.MapControl1.refreshCallback(MapControl1.java:1027)
        at com.supermap.mapping.MapControlNative.jni_SetSize(Native Method)
        at com.supermap.mapping.MapControl1.a(MapControl1.java:1173)
        at com.supermap.mapping.MapControl1.c(MapControl1.java:342)
        at com.supermap.mapping.MapControl1$3.surfaceCreated(MapControl1.java:305)
        at android.view.SurfaceView.updateWindow(SurfaceView.java:543)
        at android.view.SurfaceView.access$000(SurfaceView.java:81)
        at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:169)
        at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:671)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1818)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
        at android.view.Choreographer.doCallbacks(Choreographer.java:555)
        at android.view.Choreographer.doFrame(Choreographer.java:525)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
        at android.os.Handler.handleCallback(Handler.java:615)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        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:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)
08-27 11:46:55.346 7026-7030/? D/dalvikvm: GC_CONCURRENT freed 93K, 7% free 14387K/15431K, paused 13ms+5ms, total 65ms
08-27 11:46:55.425 7026-7026/? E/SurfaceTextureClient: Surface::lock failed, already locked
08-27 11:46:55.432 7026-7026/? E/SurfaceHolder: Exception locking surface
    java.lang.IllegalArgumentException
        at android.view.Surface.lockCanvasNative(Native Method)
        at android.view.Surface.lockCanvas(Surface.java:88)
        at android.view.SurfaceView$4.internalLockCanvas(SurfaceView.java:754)
        at android.view.SurfaceView$4.lockCanvas(SurfaceView.java:730)
        at com.supermap.mapping.MapControl1.c(MapControl1.java:332)
        at com.supermap.mapping.MapControl1.refreshCallback(MapControl1.java:1027)
        at com.supermap.mapping.MapControlNative.jni_Paint(Native Method)
        at com.supermap.mapping.MapControl1.d(MapControl1.java:1187)
        at com.supermap.mapping.MapControl1.c(MapControl1.java:349)
        at com.supermap.mapping.MapControl1$3.surfaceCreated(MapControl1.java:305)
        at android.view.SurfaceView.updateWindow(SurfaceView.java:543)
        at android.view.SurfaceView.access$000(SurfaceView.java:81)
        at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:169)
        at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:671)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1818)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
        at android.view.Choreographer.doCallbacks(Choreographer.java:555)
        at android.view.Choreographer.doFrame(Choreographer.java:525)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
        at android.os.Handler.handleCallback(Handler.java:615)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        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:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)
8月 27, 2018 分类:  440次浏览 | 用户: BigGoooood (2 分)

2 个回答

0 投票
你好,判断一下工作空间是否已经打开成功?还有在桌面中重新建一个工作空间,拷贝到设备中,看是否会报错
8月 27, 2018 用户: 董懿鑫 登峰造极 (5,818 分)
0 投票
您好,这个错误日志与地图不显示无关,只是SDK中使用的一些异常信息,不影响使用

您用的是那个版本?检查一下Environment.setOpenGLMode()是否存在,如果有可以将其设置为true,OpenGL模式下不会有这个日志。

关于数据是否打开,通过Workspace.open(),Map.open()的返回值可以检查是否打开成功,如果失败,请检查一下许可。如果成功,可以检查一下Layout布局中MapView或MapControl是否正确,已经Map是否与MapControl 或MapView关联。
8月 27, 2018 用户: 幸俊 学富五车 (694 分)
...