What worked for me was to get Java directly from Please login to see this link..
I point to that directory: C:\Program Files\Java\jdk-11 and not to Android Studio.
Edit: Another tip is to build a blank Android project from a blank .mfa. If that doesn't build, there's a problem with your setup. If that builds, then the problem is probably your extensions.
I got it! It was two old extensions. Android obb and android old ini!