简体   繁体   中英

Error:Execution failed for task: ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2

Error: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_79\\bin\\java.exe'' finished with non-zero exit value 2

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('poi-3.13-beta1-20150723.jar')
    compile 'com.android.support:appcompat-v7:22.2.1'
}

I finally crack the solution this error was occurring because my code was exceeding max-limit. I fount an useful link to solve this: https://developer.android.com/tools/building/multidex.html

When you face this kind of problem like 'C:\\Program Files\\Java\\jdk1.7.0_79\\bin\\java.exe' finished with non-zero exit value 2

It means you need to verify all the dependencies, manifests and the modules you have attached to the project. The problem is now due to any update or any of the reason their is some problem in any the file code

Possible reason:-

  • Minimum SDK version is too low
  • Any of resource file issue
  • Any of manifest is showing any error
  • You declared multiple Launch Activity
  • You may need to enable MultiDex now

In short, just go through all files and try to find the issue with Project or Modules.

Best approach : Clean Project, Rebuild Project, Synchronize and try to install application.

(Any of the above step may show you an error in any of your file which is actually causing this problem)

对我来说,当我删除/ app / libs文件夹中的jar文件时,它已经解决了,因为也在/app/buld.gradle中声明了

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM