@jonmac is correct with this change! If you create a project with newer Android Studio versions, it sets up a centralized repository declaration (which is the last code block in the post above) rather than requiring you to declare your repositories in each submodule.
While we don’t need it in this particular app, in real apps there’s a great chance you’ll want multiple modules meaning this helps a bunch.
If you want more info, check out this link: Declaring repositories