Glad that it helped, I don’t usually post =))
Two more things in case more people get stuck:
1 - If you have recently installed or updated Android Studio, it installs java version 11, but unreal 4 relies heavily on java 8 as of now, so it is better simply point the variable to that. But keep in mind that if you ever use android studio, you might again need java 11 for some specific library to compile/work, so you might have to change that back OR change android studio settings to make it use java version at a manually defined path (point to java 11).
2 - If your game does not package, remove sdk build tools version 31.0.0 and install 30.0.3 or lower. See my answer here for more details.