
After I installed two versions of JDK (17 and 21) and uninstalled them, I saw this error when trying to launch my Android Studio. This error is hard to fix. Reinstalling Android Studio won’t fix it. And even after I searched google and asked chatGPT and try all the suggestion they give, the problem continued for two days.
The eventual solution is from a StackOverflow article (sorry I forget the url):
Shell
x
8
1
# firstly, manually uninstall Android Studio
2
# then
3
rm -rf /Library/Java/JavaVirtualMachines/*
4
# then
5
rm ~/Library/Application\ Support/Google/AndroidStudio*
6
# then
7
rm -rf ~/Library/Caches/
8
# now install the Android Studio and it could be launched correctly