Error al abrir un projecto de ionic con studio android -- Error opening an ionic project with studio android

Hello
I’m doing the example from the Ionic page, “ionic start photo-gallery tabs --type=angular --capacitor”

And to the ionic cap open android, it gives me this error.

java.lang.NullPointerException
at org.gradle.wrapper.PathAssembler.getDistName(PathAssembler.java:84)
at org.gradle.wrapper.PathAssembler.getDistribution(PathAssembler.java:40)

Thank you

Hola,
estoy realizando el ejemplo de la página de Ionic, “ionic start photo-gallery tabs --type=angular --capacitor”

Y al ionic cap open android, me da este error.
java.lang.NullPointerException
at org.gradle.wrapper.PathAssembler.getDistName(PathAssembler.java:84)
at org.gradle.wrapper.PathAssembler.getDistribution(PathAssembler.java:40)
Gracias.

try npx cap open android.

You get the error inside android studio or from the command line?

Do you have android studio installed?

I get the error inside android studio.
Yes, I have android studio installed.

what version of jdk and gradle are you using?

Gradle 7.0

Build time: 2021-04-09 22:27:31 UTC
Revision: d5661e3f0e07a8caff705f1badf79fb5df8022c4

Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant™ version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_311 (Oracle Corporation 25.311-b11)
OS: Windows 10 10.0 amd64

Does the problem persist with JDK 11 instead of 8?

Yes, the problem persist with JDK 11 too