bluelinelabs / Conductor

A small, yet full-featured framework that allows building View-based Android applications
Apache License 2.0
3.89k stars 342 forks source link

Fatal Exception: java.lang.IllegalStateException #599

Closed TikTak123 closed 3 years ago

TikTak123 commented 4 years ago

Conductor version: implementation 'com.bluelinelabs:conductor:3.0.0-rc2'

API level: Android 5, 8, 9

Error log:

Fatal Exception: java.lang.IllegalStateException: Unable to retrieve TransactionIndexer from null host controller
       at com.bluelinelabs.conductor.ControllerHostedRouter.getTransactionIndexer(ControllerHostedRouter.java:249)
       at com.bluelinelabs.conductor.Router.performControllerChange(Router.java:784)
       at com.bluelinelabs.conductor.Router.performControllerChange(Router.java:775)
       at com.bluelinelabs.conductor.Router.pushController(Router.java:186)
       at com.example.ui.main.main.TabMainController.gotoGigiDetalization(TabMainController.java:312)
       at com.example.ui.main.main.TabMainViewModel$init2$3.onItemClick(TabMainViewModel.java:145)
       at com.example.ui.main.main.TabMainViewModel$init2$3.onItemClick(TabMainViewModel.java:123)
       at com.example.ui.main.main.TabMainAlertAdapter$GigiOfferViewHolder.lambda$new$0(TabMainAlertAdapter.java:214)
       at com.example.ui.main.main.-$$Lambda$TabMainAlertAdapter$GigiOfferViewHolder$HrU_jyR-rNJvFUtEUf_YZD9g448.onClick(-.java)
       at android.view.View.performClick(View.java:4827)
       at android.view.View$PerformClick.run(View.java:20235)
       at android.os.Handler.handleCallback(Handler.java:810)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:209)
       at android.app.ActivityThread.main(ActivityThread.java:5916)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1005)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:800)
TikTak123 commented 3 years ago

I think this crash related to this crash https://github.com/bluelinelabs/Conductor/issues/515 I tried to reproduce this crash like said @chichkanov but I can't repoduce it. I was able to reproduce it manuаlly with postDelay. In my architecture I have master controller and in master controller I have child controller and bottom navigation. I added code to one of my controller which push controller after 5 second. But before this push happens I switch to another tab in bottom navigation with setRoot and then after few second code in postDelay trigger and this crash happens.

TikTak123 commented 3 years ago

I also tried to run monkey test for my application and wanted to reproduce the crashes that I declared here, but I could not reproduce any of them.

EricKuck commented 3 years ago

This should be fixed in the 3.0.0 release. Please feel free to reopen if you still have the issue after updating!

TikTak123 commented 3 years ago

This crash did not occur in version 3.0 stable. But for the latest SNAPSHOT version it happens again. In latest version of my app I enabled minification and obfuscation code.