1 votes

Could not find method dependencyResolutionManagement() for arguments [] on settings 'MyApplication' of type org.gradle.initialization.DefaultSettings

When I run the app in an emulator, it generates the following error > Could not find method dependencyResolutionManagement() for arguments [] on settings 'MyApplication' of type org.gradle.initialization.DefaultSettings

Thank you in advance!

Build.gradle looks like this

plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    compileSdk 31

    defaultConfig {
        applicationId "com.example.myapplication"
        minSdk 21
        targetSdk 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

2voto

Elenasys Points 67941

The problem is that you are trying to call a method which does not exist.

It seems to me that you are using "Android Studio Arctic Fox" if I'm not mistaken, and this has some problem with the version of gradle you use, inside your file gradle-wrapper.properties change the url where the gradle distribution is defined to the version 7.0-rc-1 :

distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-rc-1-bin.zip

0 votes

Thank you very much!

HolaDevs.com

HolaDevs is an online community of programmers and software lovers.
You can check other people responses or create a new question if you don't find a solution

Powered by:

X