Skip to content

Crash if you change theme mode several times #528

@mecuricat

Description

@mecuricat

Checklist

  • I am using the latest version - 1.6.0
  • I checked, but didn't find any duplicates (open OR closed) of this issue in the repo.
  • This issue contains only one bug. I will open one issue for every bug report I want to file.

Steps to reproduce the bug

  1. Go to Settings >> Theme mode
  2. Switch several times to different themes.

Actual behaviour

App crashes. Reproducible via above steps.

Expected behavior

Themes change smoothly without crash regardless of how frequently you change.

Screenshots/Screen recordings

koler.krash.mp4

Logs

Crash log

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.chooloo.www.koler/com.chooloo.www.koler.ui.main.MainActivity}: androidx.fragment.app.Fragment$h: Unable to instantiate fragment k3.r: could not find Fragment constructor
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3834)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3980)
	at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5989)
	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5880)
	at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71)
	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2394)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:211)
	at android.os.Looper.loop(Looper.java:300)
	at android.app.ActivityThread.main(ActivityThread.java:8296)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Caused by: androidx.fragment.app.Fragment$h: Unable to instantiate fragment k3.r: could not find Fragment constructor
	at androidx.fragment.app.Fragment.a0(Unknown Source:94)
	at androidx.fragment.app.l.f(Unknown Source:0)
	at androidx.fragment.app.w$d.a(Unknown Source:17)
	at androidx.fragment.app.b0.a(Unknown Source:2)
	at androidx.fragment.app.c0.<init>(Unknown Source:13)
	at androidx.fragment.app.w.i1(Unknown Source:245)
	at androidx.fragment.app.w.m(Unknown Source:136)
	at androidx.fragment.app.m.a(Unknown Source:4)
	at androidx.fragment.app.j.W(Unknown Source:3)
	at androidx.fragment.app.j.O(Unknown Source:0)
	at androidx.fragment.app.i.a(Unknown Source:2)
	at c.a.c(Unknown Source:20)
	at androidx.activity.ComponentActivity.onCreate(Unknown Source:7)
	at androidx.fragment.app.j.onCreate(Unknown Source:0)
	at k3.d.onCreate(Unknown Source:0)
	at android.app.Activity.performCreate(Activity.java:8523)
	at android.app.Activity.performCreate(Activity.java:8487)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1438)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3815)
	... 15 more
Caused by: java.lang.NoSuchMethodException: k3.r.<init> []
	at java.lang.Class.getConstructor0(Class.java:2363)
	at java.lang.Class.getConstructor(Class.java:1759)
	at androidx.fragment.app.Fragment.a0(Unknown Source:15)
	... 33 more

Device info

  • Android version/Custom ROM version: Android 13
  • Device model: Xiaomi Redmi Note 10 Pro

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions