You hit this error message on Visual Studio Code (or Android Studio) for your IonicFramework project after you upgraded Java in your computer:
Supplied javaHome is not a valid folder. You supplied: <folder_name_with_path>
What Is The Solution?
a). Make sure Android Studio > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK is pointing to the correct JDK version. Save all for changes.
b). For Windows, go to this folder "C:\Users\<your_Windows_user_name>\.gradle", delete all of the files and folders.
c). Go to "<your_project_folder>\android\.gradle" folder, delete all of the files and folders.
d). Run the commands below as usual:
ionic build
npx cap copy
npx cap sync
npx cap open android