Problem with gradle plugin

I have this error:

This in my wrapper:
distributionUrl=https://services.gradle.org/distributions/gradle-7.3-all.zip

This in my settings.gradle:

repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }

This in my app build.gradle:

plugins {
    id "com.android.application"
    id "dev.flutter.flutter-gradle-plugin"
    id "kotlin-android"
}

And this in my build.gradle:

repositories {
        google()
        jcenter()
        mavenCentral()
    }

Any help is appreciated!

And I tried with the version codes as well.

However, you posted the code and error message from when you were missing the version, so the only thing we can tell is that you need to add the version. Post your attempt with the version and then we can see if there’s something else wrong with the attempt.

1 Like

Sorry I have been really busy, thanks for answering.
I added
version “7.3”
to my id “com.android.application”

But now it just says:
Plugin [id: ‘com.android.application’, version: ‘7.3’] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
  • Included Builds (None of the included builds contain this plugin)
  • Plugin Repositories (could not resolve plugin artifact ‘com.android.application:com.android.application.gradle.plugin:7.3’)
    Searched in the following repositories:
    Google
    MavenRepo
    Gradle Central Plugin Repository

Do I have a wrong version number and how do i know what is the right one?

The com.android.application plugin uses full semantic versioning with major.minor.patch. If you need 7.3 you should add the .0 to have 7.3.0 or use 7.3.1, which is the latest patch of 7.3.

Make sure to not confuse AGP version with Gradle version.
Those are not related and 7.3 is the Gradle version you are using.
That the plugin artifact of that plugin is just called gradle was imho a very unlucky choice by Google.