androidandroid-studiogradleandroid-gradle-plugindetekt

Minimum supported Gradle version is 8.7. Current version is 8.2. Android


I want to run the command gradle detekt on Android Studio's terminal but I always get the error:

A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.version-check'.
   > Minimum supported Gradle version is 8.7. Current version is 8.2. If using the gradle wrapper, try editing the distributionUrl in C:\Users\...\gradle\wrapper\gradle-wrapper.properties to gradle-8.7-all.zip

But my gradle-wrapper.properties is the following:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

It is already set on gradle-8.7-all.zip I also have invalidated cache and restarted.

On project structure I have this enter image description here

Why AS is still saying that my version is 8.2 when I run the command?

I have the "Wrapper" distribution on Gradle settings enter image description here Thanks


Solution

  • When you run gradle you are running the Gradle version installed globally on your system.

    To use the locally installed wrapper, you need to run the file gradlew instead (or gradlew.bat on Windows), located in your project root directory1.


    1 Documentation