用Android Studio编译一个app,出现错误:
CreateProcess error=216, 该版本的 %1 与您运行的 Windows 版本不兼容。
经多方查找,确定原因是:Android Studio 中内嵌的JDK 为64位版本,本人Windows为32位。
参考:https://code.google.com/p/android/issues/detail?id=219524
This happens because for now we only bundle the 64bit JRE on Windows. Two things: - do not use the embedded JDK: in the Project Structure dialog, uncheck the box and select the 32-bit JRE you've been using so far; - decrease the memory footprint for Gradle in gradle.properties, for instance set it to -Xmx768m.
解决方案
菜单 File-->Other Settings-->Default Project Structure, 在此对话框中清除 Use Embedded JDK 选项,选择自己安装的JDK即可。若修改后遇到以下错误:
"Gradle sync failed: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html Please read the following process output to find out more:"则再去修改安装目录下: Android\Android Studio\bin\studio.exe.vmoptions
-Xmx750m -> -Xmx512m -XX:MaxPermSize=350m -> -XX:MaxPermSize=250m调整JVM内存设置即可解决。