Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find method dependencyResolutionManagement() for arguments

I'm trying to use a project which my teacher gave to me, but it shows me an error

    Settings file '/Users/admin/AndroidStudioProjects/HTTPNetworking/settings.gradle' line: 1

A problem occurred evaluating settings 'HTTPNetworking'.
> Could not find method dependencyResolutionManagement() for arguments [settings_d1xerae4a210x6r7efckrwyki$_run_closure1@580a3803] on settings 'HTTPNetworking' of type org.gradle.initialization.DefaultSettings.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating settings 'HTTPNetworking'.
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method dependencyResolutionManagement() for arguments [settings_d1xerae4a210x6r7efckrwyki$_run_closure1@580a3803] on settings 'HTTPNetworking' of type org.gradle.initialization.DefaultSettings
at settings_d1xerae4a210x6r7efckrwyki.run(/Users/admin/AndroidStudioProjects/HTTPNetworking/settings.gradle:1)

settings.gradle contains:

dependencyResolutionManagement {
   repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
      repositories {
         google()
         mavenCentral()
         jcenter() // Warning: this repository is going to shut down soon
      }
}
rootProject.name = "HTTP Networking"
include ':app'

What's wrong with it?

like image 749
basic_user Avatar asked May 12 '26 00:05

basic_user


1 Answers

This error can be caused by defining the dependencyResolutionManagement block in a build.gradle file instead of in the settings.gradle (which is where the doco clearly tells you to put it).

Not that I did that or anything. Feel free to upvote this answer if you also totally did not make this obviously dumb mistake.

like image 187
Shorn Avatar answered May 13 '26 14:05

Shorn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!