Crash on Home Screen
Steps to reproduce
- Open Session
- Click on "tabs" icon to go to Home
- Click on Menu -> Open Settings
- Click Back
- On Home Screen, click on your created session in list
Expected behavior
Session opens
Actual behavior
Crashes
io.reactivex.exceptions.OnErrorNotImplementedException: View androidx.coordinatorlayout.widget.CoordinatorLayout{957ab20 V.E...... .......D 0,0-1080,1962} does not have a NavController set at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704) at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701) at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77) at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:67) at io.reactivex.subjects.PublishSubject$PublishDisposable.onNext(PublishSubject.java:309) at io.reactivex.subjects.PublishSubject.onNext(PublishSubject.java:229) at io.reactivex.subjects.SerializedSubject.onNext(SerializedSubject.java:105) at org.mozilla.fenix.home.tabs.TabsAdapter$TabViewHolder$1.onClick(TabsAdapter.kt:58) at android.view.View.performClick(View.java:6597) at android.view.View.performClickInternal(View.java:6574) at android.view.View.access$3100(View.java:778) at android.view.View$PerformClick.run(View.java:25885) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6718) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.IllegalStateException: View androidx.coordinatorlayout.widget.CoordinatorLayout{957ab20 V.E...... .......D 0,0-1080,1962} does not have a NavController set at androidx.navigation.Navigation.findNavController(Navigation.java:83) at org.mozilla.fenix.home.HomeFragment$onViewCreated$1.accept(HomeFragment.kt:74) at org.mozilla.fenix.home.HomeFragment$onViewCreated$1.accept(HomeFragment.kt:39)
Device information
- Android device: Pixel 3
- Fenix version: Master as of Fri 2/15/19
┆Issue is synchronized with this Jira Task
This was caused by https://github.com/mozilla-mobile/fenix/commit/ac145c0232ae1b39f583dd654cf98a71f2e22180
Looks like the subscription in onCreateView is happening twice, capturing an old view. We'll have to account for the view lifecycle in these cases
The crash is no longer reproducible, the home screen is successfully displayed when going back from the settings.
Verified on:
- 1.0.1910 (Build #10642115)
Devices:
- Nokia 6 (Android 7.1.1)
- HTC Desire 820 (Android 6.0.1)