It was extending to ComponentActivity(), I replaced it with what you said now
and I added the theme it themes.xls
I synced gradle and got this when building
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
error: resource style/Theme.MaterialComponents.DayNight.DarkActionBar (aka com.bignerdranch.android.criminalintent:style/Theme.MaterialComponents.DayNight.DarkActionBar) not found.
error: failed linking references.
Ok yup. It looks like you might have used a different project template than what we wanted when creating Criminal Intent. That is fine and you definitely do not have to start the project fresh. I think we can get things where they need to be by just adding these lines to your dependencies (similar to what you did for the ViewModel libraries and the Fragment library):
As a side note, you should use the new project “Empty Views Activity” template for every project in the book. In the past few months, Google changed the “Empty Activity” template to include Jetpack Compose and removed some stuff that our apps need. Feel free to use the “Empty Activity” template in projects once you are done reading the BNR book, but the BNR book assumes that you are using the “Empty Views Activity”. Sorry for the confusion.