title: Could not find method dependencyResolutionManagement() for arguments [build_ckqar66poaozqtyzw4dyn6sx4$_run_closure3@a921a13] on project app
body: <p>I have a trouble in my build.gradle file because there is a method called dependencyResolutionManagement() but I don't know how to solve it.
  The error says that there are not method.
  This is the message:
  Also I have an error that says 'Cannot Resolve symbol 'RepositoriesMode' on my build gradle.
  I think I was modifying my build.gradle to add some dependence but I did something wrong. These are the message and my build.gradle file</p>
  <pre><code>    build.gradle
  
      1 error
  
      Could not find method dependencyResolutionManagement() for arguments [build_ckqar66poaozqtyzw4dyn6sx4$_run_closure3@a921a13] on project ':app' of type org.gradle.api.Project
  
      This is my build.gradle file
  
      Cannot resolve symbol 'RepositoriesMode'
  
      import org.gradle.api.initialization.resolve.RepositoriesMode
  
      plugins {
          id 'com.android.application'
          id 'com.google.gms.google-services'
       }
  
      android {
          compileSdk 31
          buildToolsVersion &quot;30.0.3&quot;
  
          defaultConfig {
             applicationId 'com.example.myapp'
            minSdk 21
             targetSdk 30
              versionCode 1
              versionName &quot;1.0&quot;
  
              testInstrumentationRunner                     &quot;androidx.test.runner.AndroidJUnitRunner&quot;
           }
          allprojects {
             repositories {
                 google()
                 mavenCentral()
              }
          }
          buildTypes {
               release {
                  minifyEnabled false
                  proguardFiles getDefaultProguardFile('proguard-       a.ndroid-optimize.txt'), 'proguard-rules.pro'
             }
          }
          compileOptions {
               sourceCompatibility JavaVersion.VERSION_1_8
               targetCompatibility JavaVersion.VERSION_1_8
           }
           buildFeatures {
               viewBinding true
           }
       }
  
       dependencies {
           implementation 'com.google.android.gms:play-services-ads:20.5.0'
           implementation 'androidx.appcompat:appcompat:1.2.0'
           implementation platform('com.google.firebase:firebase-bom:29.0.3')
           implementation 'com.google.firebase:firebase-analytics'
           implementation 'com.google.firebase:firebase-inappmessaging'
           implementation 'com.google.android.material:material:1.3.0'
           implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
           implementation 'com.google.android.gms:play-services-ads:20.5.0'
           testImplementation 'junit:junit:4.13.2'
            androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
      }
  
      dependencyResolutionManagement {
                             repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
                   repositories {
                        google()
                        mavenCentral()
                        jcenter()
               maven { url 'https://jitpack.io' }
           }
       }
                rootProject.name = &quot;appname&quot;
                include ':app'
  </code></pre>
  <p>I tried Invalidate- Restart Caché but it didn't work. I think I was modifying the build.gradle code and I made something wrong.</p>