I finally fixed the issue. This may be a workaround but it works.
So if anyone having this issue, just follow this:
-
Swap the position of
jcenter()andgoogle()in project gradle file and in also all the other module you have in your project. Like in mine I havecrashlytics,fabricso just remember to make the changes in theirbuild.gradlefile as well:buildscript { repositories { jcenter() google() } }to
buildscript { repositories { google() jcenter() } } -
Before building your project again go to your project folder and delete the
.gradlefolder from your project and then build your project.