在android studio中编写应用程序时,构建过程突然停止工作。我得到9个错误:
":app:preDexDebug
Error:Could not create the Java Virtual Machine.
Error:A fatal exception has occurred. Program will exit.
Error:Could not create the Java Virtual Machine.
Error:A fatal exception has occurred. Program will exit.
Error:Could not create the Java Virtual Machine.
Error:A fatal exception has occurred. Program will exit.
Error:Could not create the Java Virtual Machine.
Error:A fatal exception has occurred. Program will exit.
Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\NAME\AppData\Local\Android\sdk\build-tools\21.1.2\dx.bat --dex --output C:\Users\NAME\AndroidStudioProjects\MyApplication\app\build\intermediates\pre-dexed\debug\internal_impl-21.0.3-56fc23d6165fcb12f6f6bed1589449dbd02c62e2.jar C:\Users\NAME\AndroidStudioProjects\MyApplication\app\build\intermediates\exploded-aar\com.android.support\support-v4\21.0.3\libs\internal_impl-21.0.3.jar
Error Code:
1
Output:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit."
有时在尝试启动虚拟设备时,我收到此消息:
"Failed to complete Gradle execution.
Cause:"
在该窗口中单击“确定”后,我得到了这个:
"Unexpected Error
Local path doesn't exist. Local path doesn't exist. The project may need to be synced with Gradle files. Sync Project with Gradle files"
重新安装Android Studio和创建新项目
后仍会发生这种情况答案 0 :(得分:0)
尝试重新安装Java。您需要JDK 1.7版才能获得最新版本。
如果您有基于64位的SO并且启动studio64而不是工作室可执行文件,则必须下载64位版本的JDK。