Running Gradle build failed

Hi there, I’ve been following the Build Your First App: Angular guide but I’m really stuck at the live reload part, I’ve managed to run the app on my phone with Ionic cap open android but when I try to do the Live Reload part, I get the following error when I run the command ionic cap run android -l --external

[capacitor] × Running Gradle build - failed!
[capacitor] [error]
[capacitor] FAILURE: Build failed with an exception.
[capacitor]
[capacitor] * What went wrong:
[capacitor] A problem occurred configuring root project ‘android’.
[capacitor] > Could not resolve all files for configuration ‘:classpath’.
[capacitor] > Could not resolve com.android.tools.build:gradle:8.2.2.
[capacitor] Required by:
[capacitor] project :
[capacitor] > No matching variant of com.android.tools.build:gradle:8.2.2 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute ‘org.gradle.plugin.api-version’ with value ‘8.2’ but:
[capacitor] - Variant ‘apiElements’ capability com.android.tools.build:gradle:8.2.2 declares a library, packaged as a jar, and its dependencies declared externally:
[capacitor] - Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
[capacitor] - Other compatible attribute:
[capacitor] - Doesn’t say anything about org.gradle.plugin.api-version (required ‘8.2’)
[capacitor] - Variant ‘javadocElements’ capability com.android.tools.build:gradle:8.2.2 declares a component for use during runtime, and its dependencies declared externally:
[capacitor] - Incompatible because this component declares documentation and the consumer needed a library
[capacitor] - Other compatible attributes:
[capacitor] - Doesn’t say anything about its target Java version (required compatibility with Java 8)
[capacitor] - Doesn’t say anything about its elements (required them packaged as a jar)
[capacitor] - Doesn’t say anything about org.gradle.plugin.api-version (required ‘8.2’)
[capacitor] - Variant ‘runtimeElements’ capability com.android.tools.build:gradle:8.2.2 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
[capacitor] - Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
[capacitor] - Other compatible attribute:
[capacitor] - Doesn’t say anything about org.gradle.plugin.api-version (required ‘8.2’)
[capacitor] - Variant ‘sourcesElements’ capability com.android.tools.build:gradle:8.2.2 declares a component for use during runtime, and its dependencies declared externally:
[capacitor] - Incompatible because this component declares documentation and the consumer needed a library
[capacitor] - Other compatible attributes:
[capacitor] - Doesn’t say anything about its target Java version (required compatibility with Java 8)
[capacitor] - Doesn’t say anything about its elements (required them packaged as a jar)
[capacitor] - Doesn’t say anything about org.gradle.plugin.api-version (required ‘8.2’)
[capacitor]
[capacitor] * Try:
[capacitor] > Run with --stacktrace option to get the stack trace.
[capacitor] > Run with --info or --debug option to get more log output.
[capacitor] > Run with --scan to get full insights.
[capacitor] > Get more help at https://help.gradle.org.
[capacitor]
[capacitor] BUILD FAILED in 1s
[capacitor]
[ERROR] An error occurred while running subprocess capacitor.

    capacitor.cmd run android --no-sync --target RXCTC01YLZL exited with exit code 1.

gradle 8 requires java 17 and you are using java 8

Yes, thank you, after downloading it, and restarting the pc it worked