3

i have problim when trying to run flutter run in cmd

  • Error running Gradle: ProcessException: Process "xx\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

  • Where: Build file 'xx\android\app\build.gradle' line: 61

  • What went wrong: A problem occurred evaluating project ':app'.

    Could not find method classpath() for arguments [com.android.tools.build:gradle:3.3.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

app/build.gradle

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    classpath 'com.android.tools.build:gradle:3.3.0'
    classpath 'com.google.gms:google-services:4.2.0'

}

build.gradle

dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
    }

gradle.properties

android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx1536M

1 Answer 1

6

In your app/build.gradle you have to remove these dependencies:

dependencies {
    classpath 'com.android.tools.build:gradle:3.3.0'  //to be removed
    classpath 'com.google.gms:google-services:4.2.0'  //to be removed
}

In your build.gradle (main folder) you have to add in the buildscript block :

buildscript {
    repositories {
        google()
        //... others
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.google.gms:google-services:4.2.0'

        // others...
    }
}
Sign up to request clarification or add additional context in comments.

1 Comment

Please look into this question I tried to solve it but could not solve it stackoverflow.com/questions/56513672/… @Gabriele Mariotti

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.