atahabaki / wordbook-android

An android app for linguists...
https://atahabaki.github.io/wordbook-android/
GNU General Public License v3.0
16 stars 2 forks source link

šŸ› Crash Report (EditFrag 2 EditFrag action/dest !exist) #35

Open atahabaki opened 3 years ago

atahabaki commented 3 years ago

Reproducible?

Yes, select an item, change the theme dark - light, app crashes...

2021-08-25 16:15:10.634 28020-28020/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: dev.atahabaki.wordbook, PID: 28020
    java.lang.IllegalArgumentException: Navigation action/destination dev.atahabaki.wordbook:id/action_nav_menu_wordbook_to_editFragment cannot be found from the current destination Destination(dev.atahabaki.wordbook:id/editFragment) label=EditFragment class=dev.atahabaki.wordbook.ui.word.EditFragment
        at androidx.navigation.NavController.navigate(NavController.java:940)
        at androidx.navigation.NavController.navigate(NavController.java:877)
        at androidx.navigation.NavController.navigate(NavController.java:863)
        at androidx.navigation.NavController.navigate(NavController.java:1159)
        at dev.atahabaki.wordbook.ui.WordBookActivity.onCreate$lambda-2(WordBookActivity.kt:120)
        at dev.atahabaki.wordbook.ui.WordBookActivity.$r8$lambda$DbbnQzDuP3ySbIVhy_oLD9QdJiU(Unknown Source:0)
        at dev.atahabaki.wordbook.ui.WordBookActivity$$ExternalSyntheticLambda7.onChanged(Unknown Source:6)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:146)
        at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:468)
        at androidx.lifecycle.LiveData$LifecycleBoundObserver.onStateChanged(LiveData.java:425)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:354)
        at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:265)
        at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:307)
        at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:148)
        at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:134)
        at androidx.lifecycle.ReportFragment.dispatch(ReportFragment.java:68)
        at androidx.lifecycle.ReportFragment$LifecycleCallbacks.onActivityPostStarted(ReportFragment.java:187)
        at android.app.Activity.dispatchActivityPostStarted(Activity.java:1252)
        at android.app.Activity.performStart(Activity.java:7884)
        at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3294)
        at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
        at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
2021-08-25 16:15:10.651 1438-3887/? W/ActivityTaskManager:   Force finishing activity dev.atahabaki.wordbook/.ui.WordBookActivity
atahabaki commented 3 years ago

Postponed due to lack of progress.

atahabaki commented 2 years ago

Finally! Got back to the work, I believe that this is all about the ViewModel structure I useā€¦ So I need to rebuild the ViewModel structure far betterā€¦ It fails to create/launch the fragment from that destination 'cause it does not hold any argument after the theme has changed. Without that argument it can't rebuild the fragment, that's why it fails I presumeā€¦