Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find method implementation() for arguments [com.google.android.material:material:1.1.0]

I am unable to run my app in the android emulator. It was working previously, but something broke it.

Error message:

A problem occurred evaluating root project 'android'.
> Could not find method implementation() for arguments [com.google.android.material:material:1.1.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

I am running gradle 3.2.1. Here is my build.gradle file's buildscript:

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        google()
        jcenter()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
    }

    dependencies {

        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.android.tools.build:gradle:3.2.1'
        implementation "com.google.android.material:material:1.1.0"

    }
}
like image 386
Kelli Avatar asked Apr 21 '26 16:04

Kelli


1 Answers

That is the top-level gradle file.

Move this line to the dependencies section of the build.gradle file inside the app folder, and also update to latest version:

implementation 'com.google.android.material:material:1.1.0-beta01'

For more info, see here: Why are there two build.gradle files in an Android Studio project?

like image 66
Daniel Nugent Avatar answered Apr 24 '26 07:04

Daniel Nugent



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!