we needed to set the JAVA_HOME variable like so…
sorted the problem for us at least.
Java 11 is not JDK 1.8 (now called JDK 8 I think). You need this specific version for Android tooling.
had the same problem reinstalled SDK didn’t work removed old sdk and reinstalled SDK did’t work
You need to delete the android folder form the platform folder and execute
ionic run android this will reinstall the platform automatically and build from scratch. I think the cache files are the problem so that is why I think this worked.
I hope it will also work for others.
Uninstall all previous JDK including 1.8 Install JDK 1.8
faced the same issue with jdk1.8.0_201.It got resolved when I made JAVA_HOME=C:\Program Files\Java\jdk1.8.0_201 and added "C:\Program Files\Java\jdk1.8.0_201\bin" in path variable
sudo update-alternatives --config java
sudo update-alternatives --config javac
ionic run android