Error Building .AAB File: Could Not Find com.facebook.react:react-native-gradle-plugin

I’m encountering an issue when trying to build the .aab file using the command:
./gradlew bundleRelease
The error message is as follows:

A problem occurred configuring root project 'ProjectName'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find com.facebook.react:react-native-gradle-plugin:.
     Required by:
         project :

It says the build failed because it “could not resolve all files for configuration ‘:classpath'” and could not find com.facebook.react:react-native-gradle-plugin.

The component exists in my project and is specified as a dependency in the build.gradle. It is also applied correctly. Here is a sample of my build.gradle:

Path: C:\ProjectName\front\android\build.gradle

dependencies {
    classpath("com.android.tools.build:gradle:8.0.0")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath("com.google.gms:google-services:4.3.15")
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0")
}

I have tried updating versions and making changes in both build.gradle and package.json as per recommended solutions, but the issue persists.
Here is the output of the npx react-native info command for reference:

info Fetching system and libraries information...
(node:8980) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
System:
  OS: Windows 11 10.0.26100
  CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Memory: 56.05 GB / 63.75 GB
Binaries:
  Node:
    version: 22.11.0
    path: C:Program Filesnodejsnode.EXE
  Yarn: Not Found
  npm:
    version: 10.9.0
    path: C:Program Filesnodejsnpm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 30.0.3
      - 34.0.0
      - 35.0.0
    System Images:
      - android-35 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-242.23339.11.2421.12550806
  Visual Studio: Not Found
Languages:
  Java: 17.0.13
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found