Android Studio BUILD FAILED finished with non-zero exit value

Android Studio build failed 



Android studio gradle 编译失败  错误提示:
finished with non-zero exit value 1
finished with non-zero exit value 2
finished with non-zero exit value 3

 finished with non-zero exit value 1



遇到该异常
首先
Build -> Clean Project 

然后
Build -> Rebuild Project

如果还 build 失败
原因可能是找不到相对应的资源   
导入相应了包后解决:

( 注 : 图1  )

其次 :
寻找解决方案的时候在网上还找到个  finished with non-zero exit value 1 可能出现的其它情况:
电脑内存不足 导致studio出现build failed
解决方案是 在build.gradle 的 dexOptions  增大内存设置 ( xx 替换为内存大小 )

dexOptions {
    javaMaxHeapSize "xx"
}

详情链接:  http://blog.csdn.net/serapme/article/details/46685557

 finished with non-zero exit value 2

Error:Execution failed for task 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 

Android Studio fails to debug with error org.gradle.process.internal.ExecException 

问题原因  :   jar 包冲突  , 工程里面有引用了多个相同的jar包 
解决方法:
在 project  >  build.gradle 文件  >  dependencies 里 将多余的包删除即可     
如上图   ( 图1 )

finished with non-zero exit value 3

解决方案有:
1)  增加内存(参考 value2)
2)  
替换 
"compile fileTree(dir: 'libs', include: ['*.jar'])"

"provided fileTree(dir: 'libs', include: ['*.jar'])".


参考文章:
http://stackoverflow.com/questions/29720831/finished-with-non-zero-exit-value-3
http://stackoverflow.com/questions/30483827/android-studio-java-exe-finished-with-non-zero-exit-value-3
http://stackoverflow.com/questions/29249986/finished-with-non-zero-exit-value

每日精进


//  ┏┓   ┏┓
//┏┛┻━━━┛┻┓
//┃       ┃
//┃   ━   ┃
//┃ ┳┛ ┗┳ ┃
//┃       ┃
//┃   ┻   ┃
//┃       ┃
//┗━┓   ┏━┛
//   ┃   ┃   神兽保佑
//   ┃   ┃   代码无BUG!
//   ┃   ┗━━━┓
//   ┃       ┣┓
//   ┃       ┏┛
//   ┗┓┓┏━┳┓┏┛
//     ┃┫┫ ┃┫┫
//     ┗┻┛ ┗┻┛

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值