Failure every time i try to build my flutter app

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:7.6.3.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.6.3/gradle-7.6.3.pom
       - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.6.3/gradle-7.6.3.pom
     Required by:
         project :

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 25s
Error: Gradle task assembleDebug failed with exit code 1

Don’t confuse Gradle version with Android Gradle plugin version.
Google unluckily named their plugin artifact gradle, but those versions are unrelated.
There is no such version of AGP that you try to use.
After 7.4.2 came 8.0.0.

Can you explain more please, i had updated the gradle-warber file to use gradle 8.7 and there are also error when i build my app Note: I use java 22

Not really.
What did you not understand?
You try to use Android Gradle Plugin 7.6.3 which does not exist.
Not sure what more I could say.

now i updated build.gradle file to gradle 8.7 because i searched and i know it’s working with java 22 and it’s my version of java and this is part of build.gradle file:

dependencies {
    classpath 'com.android.tools.build:gradle:8.7'  // Use the latest version
    classpath 'com.google.gms:google-services:4.4.2' 
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Ensure this is inside the buildscript block
}

Well, yeah, now you use the non-existent version 8.7 of the Android Gradle Plugin.
Again, do not confuse the version of the Android Gradle Plugin with the Gradle version.
Even if there is :gradle:, as described in my first response, this is just very unlucky naming by Google and has nothing to do with the Gradle version, it is the version of the Android Gradle Plugin.

And besides that, no, Gradle 8.7 is not fully compatible with Java 22.
It can use Java 22 as a toolchain.
But running Gradle 8.7 itself on Java 22 is not supported, only from Gradle 8.8 on.
https://docs.gradle.org/current/userguide/compatibility.html