Etar-Group / Etar-Calendar

Android open source calendar
https://f-droid.org/packages/ws.xsoh.etar/
GNU General Public License v3.0
2.04k stars 393 forks source link

Crash when trying to open on WearOS device #1655

Closed erebion closed 5 months ago

erebion commented 5 months ago

Hey there,

I know Etar does not really support WearOS at all, but I thought this might be interesting anyway.

Etar immediately crashes on a WearOS 4 device:

05-03 12:32:35.649  3095  3095 E AndroidRuntime: FATAL EXCEPTION: main
05-03 12:32:35.649  3095  3095 E AndroidRuntime: Process: ws.xsoh.etar, PID: 3095
05-03 12:32:35.649  3095  3095 E AndroidRuntime: java.lang.IllegalStateException: android.os.ServiceManager$ServiceNotFoundException: No service published for: search
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.app.Activity.ensureSearchManager(Activity.java:7045)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.app.Activity.getSystemService(Activity.java:7059)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at com.android.calendar.Utils.setUpSearchView(Utils.java:1432)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at com.android.calendar.AllInOneActivity.onCreateOptionsMenu(AllInOneActivity.java:858)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.app.Activity.onCreatePanelMenu(Activity.java:4343)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at androidx.activity.ComponentActivity.onCreatePanelMenu(ComponentActivity.java:520)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at androidx.fragment.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:287)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at androidx.appcompat.view.WindowCallbackWrapper.onCreatePanelMenu(WindowCallbackWrapper.java:95)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.onCreatePanelMenu(AppCompatDelegateImpl.java:3429)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at androidx.appcompat.app.ToolbarActionBar.populateOptionsMenu(ToolbarActionBar.java:458)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at androidx.appcompat.app.ToolbarActionBar$1.run(ToolbarActionBar.java:58)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.view.Choreographer.doCallbacks(Choreographer.java:899)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.view.Choreographer.doFrame(Choreographer.java:827)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:942)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:99)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:201)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:288)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7898)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
05-03 12:32:35.649  3095  3095 E AndroidRuntime: Caused by: android.os.ServiceManager$ServiceNotFoundException: No service published for: search
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.os.ServiceManager.getServiceOrThrow(ServiceManager.java:166)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.app.SearchManager.<init>(SearchManager.java:561)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    at android.app.Activity.ensureSearchManager(Activity.java:7043)
05-03 12:32:35.649  3095  3095 E AndroidRuntime:    ... 23 more

However, before it crashes, it briefly shows the calendar.

I'm pretty convinced that even though WearOS is not specifically supported, addressing this would make it at least somewhat usable. And also provide a way to look at a calendar without syncing via Google, as currently there is no other way to even look at other calendars (for example synced via DAVx5), as there are no apps that support that. (Believe me, I've looked at every single WearOS calendar app and could not find anything.)

Gitsaibot commented 5 months ago

We don't support WearOS but I had a short look and it seems that the search service isn't available on WearOS. I quickly tried to prevent the error so that etar does not crash. Try the debug.apk in the link but no guarantee that it will work. app-debug.zip

erebion commented 5 months ago

Try the debug.apk in the link but no guarantee that it will work.

Wow, that works already!

Finally an app that can display a non-Google calendar on WearOS. \o/

I'll play around a bit more and see if I notice any other crashes, if so I will comment again here. :)

We don't support WearOS

I know! But it works now. Of course, it is a bit fiddly, but now there is a way to look at a calendar (without using Google). I'd rather have something fiddly than nothing at all. :)

Even if you don't support it officially, it'd be really great if the fix could be included for other people that don't mind not having a watch-friendly layout. :)

erebion commented 5 months ago

I'll play around a bit more and see if I notice any other crashes, if so I will comment again here. :)

No matter what I do, for now it all seems to work just fine. :D

erebion commented 5 months ago

image

This is how it looks like. This is enough to see what the next appointment is.

If I turn down screen density via ADB, I can see a bit more. Good enough for what you would want on a watch: Seeing what's next. :)