. Advertisement .
..3..
. Advertisement .
..4..
The error: “Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]” is a common error that can show up in many ways. In this blog, we will go through some of the ways you can fix this issue. Read on.
What is “Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]”?
When attempting to build something, you might get the following problem.
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.
Cause of error
Here are the possible reasons why you are getting the above error:
– You are using an inappropriate Gradle version, so the deployment configuration is no longer supported.
Some more information for you is you must use at minimum the Gradle 3.4 or newer to be able to utilize the the implementation
. It is not advised to use the old compile
as it can cause slower time to build.
How to deal with it?
Here are some solutions for you.
Approach 1: Use implementation instead of compile.
Try replacing compile with implementation to fix this problem. Since compile has lately been deprecated in favor of implementation or api. Now you must correct your mistake.
Approach 2: Include dependencies in android/app/build.gradle
Double-check that dependencies are added to android/app/build.gradle.
Approach 3:
In case you are setting dependency like below:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
Modify it like this:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
Approach 4: Try this
buildscript {
repositories {
// Gradle 4.1 and higher include support for Google's Maven repo using
// the google() method. And you need to include this repo to download
// Android Gradle plugin 3.0.0 or higher.
google()
...
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
}
}
Conclusion
We hope you enjoyed our article about the error. With this knowledge, we know that you can fix your error: “Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]” quickly by following these steps! If you still have any other questions about fixing this syntax error, please leave a comment below. Thank you for reading!
Leave a comment