android studio 真机运行的时候gradle 报错 AGPBI: {"kind":"SIMPLE","text":"Error: C


原文出处:http://ask.android-studio.org/?/question/498
感谢原文作者: yeah258258
app:preDexDebug
AGPBI: {"kind":"SIMPLE","text":"Error: Could not create the Java Virtual Machine.","position":{},"original":"Error: Could not create the Java Virtual Machine."}
AGPBI: {"kind":"SIMPLE","text":"Error: A fatal exception has occurred. Program will exit.","position":{},"original":"Error: A fatal exception has occurred. Program will exit."}

AGPBI: {"kind":"SIMPLE","text":"Error: Could not create the Java Virtual Machine.","position":{},"original":"Error: Could not create the Java Virtual Machine."}
AGPBI: {"kind":"SIMPLE","text":"Error: A fatal exception has occurred. Program will exit.","position":{},"original":"Error: A fatal exception has occurred. Program will exit."}

AGPBI: {"kind":"SIMPLE","text":"Error: Could not create the Java Virtual Machine.","position":{},"original":"Error: Could not create the Java Virtual Machine."}
AGPBI: {"kind":"SIMPLE","text":"Error: A fatal exception has occurred. Program will exit.","position":{},"original":"Error: A fatal exception has occurred. Program will exit."}

AGPBI: {"kind":"SIMPLE","text":"Error: Could not create the Java Virtual Machine.","position":{},"original":"Error: Could not create the Java Virtual Machine."}
AGPBI: {"kind":"SIMPLE","text":"Error: A fatal exception has occurred. Program will exit.","position":{},"original":"Error: A fatal exception has occurred. Program will exit."}

FAILED

FAILURE: Build failed with an exception.
  • What went wrong:
    Execution failed for task ':app:preDexDebug'.
    com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_71\bin\java.exe'' finished with non-zero exit value 1
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
2015-07-20 19:31  添加评论  分享
0

不良人 - http://www.bit100.com

我之前遇到过,好象是因为你用Gradle引用别的项目的时候,那个项目依赖了和你相同的包,注释掉重复的,再Build --> Clean project , 之后再Build --> Rebuild Project试试。
0

JimCarter

一般来说是,jar包引用重复导致的。
1.在project structure中去掉重复的jar包,
2.如果你的jar包是放到了libs目录中,且在gradle中发现了如下代码:
compile fileTree(include: ['*.jar'], dir: 'libs')
则注释掉即可。

我是用第二种方法解决的,第一种太不好找了

你可能感兴趣的:(android)