If you are getting error in your root gradle:
Change this:
allprojects { repositories { maven { url 'https://jitpack.io' } } }
to this:
allprojects { repositories { google() mavenCentral() maven { url 'https://jitpack.io' } } }
And in your settings gradle:
Change :
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
to
repositoriesMode.set(RepositoriesMode.PREFER_PROJECT)