I’ve found the problem, it happens if the sdkmanager
(https://developer.android.com/studio/command-line/sdkmanager.html) happens to find the x86 version of Java, instead of the 64 bit version. This is probably caused by JAVA_HOME being set to the x86 version or that the x86 path is in front of the x64 path in the %PATH%
variable. The workaround is to set %JAVA_HOME%
to C:\Program Files\Java\jdk1.8.0_40
.
Also a fix is scheduled for the next release