bgregos / foreground

Simple Android personal task manager with Taskwarrior integration
Apache License 2.0
255 stars 16 forks source link

[bug] Foreground fails to launch #139

Closed soerenschneider closed 1 year ago

soerenschneider commented 2 years ago

Hi, thanks for the awesome app!

Using Graphene OS on a Pixel 4a, I'm facing a problem with foreground. I was able to set it up, sync with my taskserver, complete and create new tasks. After some time (I don't have a more accurate description), the app is not being able to start up again, being stuck at the logo.

This has happened a couple of times already - wiping the app's data and starting over works but ultimately leads to the same result again.

I was able to capture logs, it appears the app is stuck in a loop as the following logs are printed as long as I keep the app open:

03-27 19:42:50.122 29801 29801 D AndroidRuntime: Shutting down VM 03-27 19:42:50.123 29801 29801 E AndroidRuntime: FATAL EXCEPTION: main 03-27 19:42:50.123 29801 29801 E AndroidRuntime: Process: me.bgregos.brighttask, PID: 29801 03-27 19:42:50.123 29801 29801 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{me.bgregos.brighttask/me.bgregos.foreground.tasklist.MainActivity}: java.lang.RuntimeException: Unable to invoke no-args constructor for interface android.content.IIntentSender. Registering an InstanceCreator with Gson for this type may fix this problem. 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3707) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3864) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2253) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7870) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.android.internal.os.ExecInit.main(ExecInit.java:48) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: Caused by: java.lang.RuntimeException: Unable to invoke no-args constructor for interface android.content.IIntentSender. Registering an InstanceCreator with Gson for this type may fix this problem. 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:228) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:212) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.Gson.fromJson(Gson.java:927) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.Gson.fromJson(Gson.java:892) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.Gson.fromJson(Gson.java:841) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at me.bgregos.foreground.util.NotificationRepository.load(NotificationRepository.kt:99) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at me.bgregos.foreground.tasklist.TaskViewModel.(TaskViewModel.kt:68) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at me.bgregos.foreground.tasklist.TaskViewModel_Factory.newInstance(TaskViewModel_Factory.java:42) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at me.bgregos.foreground.tasklist.TaskViewModel_Factory.get(TaskViewModel_Factory.java:31) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at me.bgregos.foreground.tasklist.TaskViewModel_Factory.get(TaskViewModel_Factory.java:10) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at dagger.internal.DoubleCheck.get(DoubleCheck.java:47) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at me.bgregos.foreground.di.DaggerApplicationComponent.injectMainActivity(DaggerApplicationComponent.java:163) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at me.bgregos.foreground.di.DaggerApplicationComponent.inject(DaggerApplicationComponent.java:123) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at me.bgregos.foreground.tasklist.MainActivity.onCreate(MainActivity.kt:24) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:8054) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:8034) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1345) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3688) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: ... 14 more 03-27 19:42:50.123 29801 29801 E AndroidRuntime: Caused by: java.lang.UnsupportedOperationException: Interface can't be instantiated! Interface name: android.content.IIntentSender 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.UnsafeAllocator.assertInstantiable(UnsafeAllocator.java:117) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.UnsafeAllocator$1.newInstance(UnsafeAllocator.java:49) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:225) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: ... 38 more 03-27 19:42:50.123 29801 29801 E AndroidRuntime: Error reporting crash 03-27 19:42:50.123 29801 29801 E AndroidRuntime: java.lang.RuntimeException: Bad file descriptor 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.os.BinderProxy.transactNative(Native Method) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.os.BinderProxy.transact(BinderProxy.java:571) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at android.app.IActivityManager$Stub$Proxy.handleApplicationCrash(IActivityManager.java:5351) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at com.android.internal.os.RuntimeInit$KillApplicationHandler.uncaughtException(RuntimeInit.java:156) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068) 03-27 19:42:50.123 29801 29801 E AndroidRuntime: at java.lang.Thread.dispatchUncaughtException(Thread.java:2200) 03-27 19:42:50.123 29801 29801 I Process : Sending signal. PID: 29801 SIG: 9 03-27 19:42:50.175 1501 1790 I ActivityManager: Process me.bgregos.brighttask (pid 29801) has died: fg TOP 03-27 19:42:50.175 1501 1786 I libprocessgroup: Successfully killed process cgroup uid 10226 pid 29801 in 0ms 03-27 19:42:50.176 936 936 I Zygote : Process 29801 exited due to signal 9 (Killed)

Thanks, Sören

abog854 commented 2 years ago

Hi,

I encountered the same issue when I tried foreground a couple months ago… also on a Pixel 4a using GrapheneOS.

Exactly the same symptoms, I can use it for a couple hours after installing and then it freezes when starting it.

kristog commented 2 years ago

Hi, I also have the same problem on divestos 19 (android 12). I am able to add the server infos and sync but after that the app will be stuck on the logo when I start it again. It starts again if I clear the app storage and will get stuck again after adding the sync server.

rkmpa commented 2 years ago

@soerenschneider @bgregos I had the same issue on GrapheneOS. I rebuilt the app with gson bumped to version 2.10 inside app/build.gradle

    implementation 'com.google.code.gson:gson:2.10'

Afterwards, the app ran fine with sync enabled for a week now.

bgregos commented 1 year ago

Thanks for finding this fix! I'll be releasing this as Foreground 1.5.5 in the next few days.

soerenschneider commented 1 year ago

@bgregos Awesome, thanks! I'll try it out as soon as the release hits F-Droid!