I had this error
Error:(45, 0) Gradle DSL method not found: \'implementation()\'
Possible causes:- The project \'LaTaxi2\' may be using a
To use the DSL implementation()
you have to use:
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.
In my case it was just a typo. It was an extra sign "/" after one of rows
I ran into similar errors. when I tried to include the recyclerview dependencies from may build.gradle(Module: app) with a code like so.
//other build.gradle(Module: App) code above
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
implementation 'com.android.support:recyclerview-v7:25.3.1'
}
So the simple way I fixed this is by changing the code to this, where I changed the implement to compile while retaining every other code and their version numbers.
//other build.gradle(Module: App) code above
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:25.3.1'
}
I hope this helps some one having similar issues.
PS: The actual error was caused by implementation 'com.android.support:recyclerview-v7:25.3.1'
and changing the code to compile 'com.android.support:recyclerview-v7:25.3.1'
got it fixed.