1

Recently, I updated my Android Studio to Bumblebee(stable version) that was released around 2 weeks back. The structure of the build.gradle(root-level) file seems to have changed a lot since the last version.

I am facing issue in adding dependencies in the root-level build.gradle file.

Here is what I want to add.enter image description here

in the build.gradle file

enter image description here

Simba-97
  • 85
  • 2
  • 5

2 Answers2

4

settings.gradle instead of build.gradle:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
      // ...
        maven { url 'https://jitpack.io' }
    }
}

this way you dont need to use the build.gradle instead use the settings.gradle, these way it worked for me in Android Studio Bumblebee

1234567
  • 1,610
  • 4
  • 18
  • 50
1

I think you should use buildscript instead of allprojects. Found question in stackoverflow which explain difference between buildscript and allprojects What's the difference between buildscript and allprojects in build.gradle? So I would suggest to try:

buildscript {
    repositories {
        ...
    }
}

Hopefully this will help :)

Courtesy
  • 58
  • 6
  • Yeah, it helped but the problem was in the dependency itself, what I was trying to use was not supported for AndroidX but nevertheless thank you for your help :) – Simba-97 Feb 13 '22 at 10:42