Gradle Dsl Method Not Found: 'Implementation()'

Gradle DSL method not found: 'implementation()'

To use the DSL implementation() you have to use:

  • The updated gradle plugin for Android 3.0.0
  • The gradle version 3.4 or later

Then in your build.gradle you have to use:

buildscript {
repositories {
...
// You need to add the following repository to download the
// new plugin.
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta1'
}
}

In your gradle-wrapper.properties

distributionUrl=\
https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip

More detailed info here.

ERROR: Gradle DSL method not found: 'implementiation()' Possible causes:

It's a typo in your build.gradle. You have used implementiation instead of implementation.

Change this like below:

implementation 'com.google.firebase:firebase-perf:19.0.4'

instead of

implementiation 'com.google.firebase:firebase-perf:19.0.4'

How can I solve this error? ( ERROR: Gradle DSL method not found: 'implementation()')

You are adding the dependencies to the incorrect gradle file.

All the project dependencies (here implementation 'com.android.support:design:28.0.0') should go into your app's build.gradle file.

Look at your project structure closely, there must be 2 build.gradle files there, add this dependency to the other gradle file.

Gradle DSL method not found: 'androidTestImplementation()'

You are using the wrong build.gradle file and the wrong block.

You have to move the androidTestImplementation from the top-level file to the module/build.gradle file in the dependencies block (not the dependencies in the buildscript block)::

   apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
//...
}

dependencies {
//...
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}


Related Topics



Leave a reply



Submit