Gradle - Error Could not find method implementation() for arguments

0 votes

I am trying to open existing android project in android studio and it gradle cannot build the app without the error

Error android studio keeps on throwing

Error:(74, 1) A problem occurred evaluating project ':app'.
> Could not find method implementation() for arguments 
[com.android.support:appcompat-v7:26.0.0] on object of type 
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

My Code in build.gradle Which can help to understand my issue My dependencies

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')

// google & support
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.android.support:recyclerview-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:palette-v7:$supportVersion"
implementation "com.android.support:customtabs:$supportVersion"
implementation "com.android.support:support-v4:$supportVersion"
implementation 'com.google.android.exoplayer:exoplayer:r2.0.4'

// utils
implementation 'com.github.bumptech.glide:glide:4.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
implementation 'com.koushikdutta.ion:ion:2.1.7'
implementation 'com.github.Commit451:bypasses:1.0.4'
implementation 'com.jakewharton:butterknife:8.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'
implementation 'com.drewnoakes:metadata-extractor:2.9.1'
implementation "com.orhanobut:hawk:2.0.1"

}

Please help to solve the issue

May 26 in Java by kartik
• 26,340 points
1,411 views

1 answer to this question.

0 votes

Hello @kartik,

Make sure your gradle version 3.. or higher before using "implementation" .

Open project level gradle file under dependencies

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

open the gradle-wrapper.properties file and set the distributionUrl:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

or latest version

 Hope this solved your problem

answered May 26 by Niroj
• 56,800 points

Related Questions In Java

0 votes
1 answer

How to resolve the error: could not find or load main class?

If you are getting error: could not ...READ MORE

answered May 28, 2018 in Java by Parth
• 4,630 points
3,150 views
0 votes
2 answers

“Could not find or load main class” mean?

Use the final modifier to enforce good initialization. Avoid returning ...READ MORE

answered Sep 18, 2018 in Java by Sushmita
• 6,890 points
2,512 views
+1 vote
0 answers

getting below error when trying to conver csv file to json :The method readerFor(Class<Map>) is undefined for the type CsvMapper

PFB source code: import java.io.File; import java.lang.*; import java.util.Arrays; import java.util.List; import ...READ MORE

Dec 28, 2019 in Java by anonymous
• 160 points

closed Jan 14 by Kalgi 376 views
0 votes
1 answer

Are arrays equivalent to objects in Java ?

Yes; the Java Language Specification writes: In the Java ...READ MORE

answered May 10, 2018 in Java by Rishabh
• 3,580 points
183 views
0 votes
1 answer

Remove objects from an array in Java?

We can use external libraries: org.apache.commons.lang.ArrayUtils.remove(java.lang.Object[] array, int ...READ MORE

answered Jun 26, 2018 in Java by scarlett
• 1,270 points
184 views
0 votes
1 answer

Performance difference of if/else vs switch statement in Java

The thing you are worried about is ...READ MORE

answered Jul 26, 2018 in Java by geek.erkami
• 2,680 points
1,068 views
0 votes
1 answer

Error: Could not create the Java Virtual Machine Mac OSX Mavericks

Hello @kartik, Normally this error occurs when you ...READ MORE

answered May 21 in Java by Niroj
• 56,800 points
473 views
0 votes
1 answer

JsonMappingException: No suitable constructor found for type [simple type, class ]: can not instantiate from JSON object?

Hello @kartik, his happens for these reasons: your inner ...READ MORE

answered Apr 8 in Java by Niroj
• 56,800 points
1,880 views