Running Gradle build - failed!

I get this error track when running ionic cap run android after ionic cap add android

Could someone please help me understand what is happening?

[capacitor] √ update android in 217.84ms
[capacitor] × Running Gradle build - failed!
[capacitor] [error] WARNING:: Using flatDirs should be avoided because it doesn’t support any meta-data formats.
[capacitor] Currently detected usages:
[capacitor] - repository flatDir used in: project ‘:app’, project ‘:capacitor-cordova-android-plugins’
[capacitor] WARNING:: Please remove usages of jcenter() Maven repository from your build scripts and migrate your build to other Maven repositories.
[capacitor] This repository is deprecated and it will be shut down in the future.
[capacitor] See JCenter service update  |  Android Developers for more information.
[capacitor] Currently detected usages in: root project ‘android’, project ‘:app’, project ‘:capacitor-android’, …
[capacitor] FAILURE: Build failed with an exception.
[capacitor] * What went wrong:
[capacitor] Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.
[capacitor] > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project’s local properties file at ‘C:\xampp\htdocs\superbeauty_app\superbeauty-frontend\android\’.
[capacitor] * Try:
[capacitor] 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.
[capacitor] * Get more help at
[capacitor] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[capacitor] Use ‘–warning-mode all’ to show the individual deprecation warnings.
[capacitor] See Command-Line Interface
[capacitor] BUILD FAILED in 2s
[ERROR] An error occurred while running subprocess capacitor.

    capacitor.cmd run android --target Pixel_2_API_28 exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information

set the ANDROID_SDK_ROOT environment variable in your Operating System.