昨天三星发布了 Galaxy Watch4 的更新。从那以后,我被用户的电子邮件淹没,说我的表盘崩溃并且无法使用。当手表在正常模式和环境模式之间切换时会发生崩溃。
根据今天发布的一些文章 ( https://www.xda-developers.com/galaxy-watch-4-update-break-watch-faces),WatchFaceService.Engine在新更新中不再受支持或损坏。
令人困惑的是,当我的表盘崩溃时,其他表盘根本不会在环境模式下更新,因为显然 onTimeTick() 没有被调用。但我仍然无法弄清楚如何避免崩溃。调试信息只显示“java.lang.RuntimeException:eglCreateWindowSurface failed”,但没有指向我的代码中的任何行:
2022-02-11 11:21:55.612 4652-4652/com.xxxx.mywatchface E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xxxx.mywatchface, PID: 4652
java.lang.RuntimeException: eglCreateWindowSurface failed
at android.support.wearable.watchface.Gles2WatchFaceService$Engine.createWindowSurface(Gles2WatchFaceService.java:202)
at android.support.wearable.watchface.Gles2WatchFaceService$Engine.onSurfaceChanged(Gles2WatchFaceService.java:300)
at android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:1082)
at android.service.wallpaper.WallpaperService$Engine.reportVisibility(WallpaperService.java:1296)
at android.service.wallpaper.WallpaperService$Engine$3.onDisplayChanged(WallpaperService.java:1439)
at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage(DisplayManagerGlobal.java:767)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:7690)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
有没有人对此了解更多?如果 WatchFaceService 不再受支持,它的替代方案是什么?