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
问题原因 : ja
r 包冲突 , 工程里面有引用了多个相同的jar包
解决方法:
在 project > build.gradle 文件 > dependencies 里 将多余的包删除即可
如上图 ( 图1 )
finished with non-zero exit value 3
解决方案有:
-
增加内存(参考 value2)
替换
"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/29249986/finished-with-non-zero-exit-value