RecyclerView: No adapter attached; skipping layout

When trying to run the code of the app after implementing Listing 24.5, I am getting the error listed in the description of this topic.

I assume this error comes from the fact that the adapter is only set in onViewCreated.
How can it be fixed in the nicest way?

Should we move all RecyclerView set-up to onCreateView (including the start of the LiveData observation)?
Alternatively, initialize the adapter in onCreateView with an emptylist?