您的位置:首页 > 产品设计 > UI/UE

Android Studio BUILD FAILED finished with non-zero exit value

2016-03-03 17:24 639 查看
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-3http://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!
//   ┃   ┗━━━┓
//   ┃       ┣┓
//   ┃       ┏┛
//   ┗┓┓┏━┳┓┏┛
//     ┃┫┫ ┃┫┫
//     ┗┻┛ ┗┻┛

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: