ammargitham / WallFlow

Wallpaper app for Android using Jetpack Compose
GNU General Public License v3.0
325 stars 18 forks source link

Instantly crashing since v2.4.0 #78

Closed Lucki closed 5 months ago

Lucki commented 5 months ago

Since the update to 2.4.0 the app crashes instantly. Android makes the open animation and I get directly a small "app crashed" popup. This was with the normal version.

Now, I wanted to try the plus version anyway, which was now possible with the model download fixed. Initially it worked fine, I set up my filter and auto wallpaper and tried the object detection. Everything seemed to work with v2.4.0. The next day I expected another new wallpaper but there was still the old one. I tried opening the app but now the same instant crash happens also for the plus version. Pressing the "Quick change" button or using the android intent shows a toast message "changing wallpaper", but nothing gets changed. No notification is shown for fetching the new wallpaper. I downgraded to the previous version and that one works again, but that erased my settings and the model.

Is there a log file I can look for clues?

Lucki commented 5 months ago

I think it has something to do with the automatic wallpaper constraint "Idle" - maybe together with "wifi". Upon selecting, the app crashes, but can be opened again. Now turning off the whole automatic wallpaper setting is still fine, but turning the automatic wallpaper setting on again gives me instant crashes.

Repro:

  1. Save a filter
  2. Turn on auto wallpaper with that filter.
  3. Constrain it to "Idle", the app should crash here. (Maybe also needs "wifi")
  4. Open the app again.
  5. Turn off the whole auto wallpaper setting.
  6. Turn on the whole auto wallpaper setting. The app crashes again.
  7. App never opens again and always crashes instantly.
ammargitham commented 5 months ago

Hi. Is it possible for you to capture the crash? Using any app like this : https://f-droid.org/en/packages/com.f0x1d.logfox/.

Lucki commented 5 months ago
FATAL EXCEPTION: main
Process: com.ammar.wallflow.plus, PID: 18222
java.lang.IllegalArgumentException: Cannot set backoff criteria on an idle mode job
    at androidx.work.WorkRequest$Builder.build(SourceFile:35)
    at coil.size.Size$Companion.schedule(SourceFile:200)
    at com.ammar.wallflow.WallFlowApplication$scheduleAutoWallpaperWorker$1$1.invokeSuspend(SourceFile:147)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8)
    at kotlinx.coroutines.DispatchedTask.run(Unknown Source:96)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7664)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@c4c7f15, Dispatchers.Main.immediate]
ammargitham commented 5 months ago

Thanks. I'll fix this in the next version. Until then only thing I can suggest is to downgrade to the previous version or setup the constraint without idle.

Lucki commented 5 months ago

Thanks! I'll turn off the idle constraint for now. Importing my settings has to wait until the next version then. (downgrading removes wipes the settings) :+1:

ammargitham commented 5 months ago

Fixed in 2.4.1