Android Studio Gradle 错误CreateProcess error=216

用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内存设置即可解决。


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值