Could not find method implementation() for arguments

Fix Gradle 'Could not find method implementation()' error

Programming & Dev Tools Beginner 👁 0 views 📅 May 25, 2026

You're using Gradle 3.x or lower, but 'implementation' requires Gradle 4.0+. Update your Gradle wrapper and check the Android plugin version.

Quick answer

Update your Gradle wrapper to 4.0 or higher and your Android Gradle plugin to 3.0+.

Why this happens

You wrote implementation 'some-library' in your module-level build.gradle, but that syntax only works with Gradle 4.0 and Android Gradle plugin 3.0. If you're on Gradle 3.x (common with older projects or some CI setups) the method doesn't exist. The culprit here is almost always a stale Gradle wrapper – the gradle-wrapper.properties file points to an old version.

This error pops up when you migrate from the old compile configuration to implementation. Don't bother checking other build files first – the wrapper is what controls the Gradle version used at build time.

Fix steps

  1. Check your current Gradle version
    Open gradle/wrapper/gradle-wrapper.properties. Look for the line distributionUrl. If it says gradle-3.x or lower, that's your problem.
  2. Update the Gradle wrapper
    In your terminal or Android Studio terminal, run:
    ./gradlew wrapper --gradle-version 7.6
    This regenerates the wrapper files and sets the version. For Android projects, stick with 7.6 or 8.0 – don't jump to bleeding edge 8.5+ unless you want more breakage.
  3. Update the Android Gradle plugin
    In your root build.gradle, change the classpath line for the Android Gradle plugin:
    dependencies {
    classpath 'com.android.tools.build:gradle:7.4.2'
    }
    Use 7.4.2 for stable compatibility. Check the Android plugin version compatibility table to match your Gradle version.
  4. Sync and build
    Click "Sync Now" in Android Studio, or run ./gradlew clean assembleDebug. The error should be gone.

Alternative fixes if that doesn't work

  • Mix of 'compile' and 'implementation' in same file
    If you're stuck on Gradle 3.x (e.g., legacy CI), replace implementation back to compile. Yes, it's deprecated, but it works. Example:
    compile 'com.squareup.okhttp3:okhttp:4.9.0'
  • Wrong build.gradle file
    Make sure you edited the module-level build.gradle, not the root one. Root uses classpath, not implementation. I've seen this mistake more times than I count.
  • Corrupted Gradle cache
    Delete ~/.gradle/caches/ and the .gradle folder in your project. Rebuild. Sometimes a corrupted cache causes Gradle to ignore the wrapper version.

Prevention tip

Before you start any Android project, run ./gradlew wrapper --gradle-version 7.6 as part of your initial setup. Also, pin your Gradle version in a CI config file (like .gitlab-ci.yml or Jenkinsfile) so builds don't silently fall back to an old system Gradle installation. Keep a copy of the plugin compatibility table bookmarked.

One more thing: don't mix the new and old configuration names in the same project. Pick implementation, api, and compileOnly for new projects. If you're maintaining an old project, do a complete migration in one commit – partial upgrades cause these exact errors.

Was this solution helpful?