博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android Studio BUILD FAILED finished with non-zero exit value
阅读量:2221 次
发布时间:2019-05-08

本文共 1719 字,大约阅读时间需要 5 分钟。

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!//   ┃   ┗━━━┓//   ┃       ┣┓//   ┃       ┏┛//   ┗┓┓┏━┳┓┏┛//     ┃┫┫ ┃┫┫//     ┗┻┛ ┗┻┛

你可能感兴趣的文章
PCA 的数学原理和可视化效果
查看>>
机器学习中常用评估指标汇总
查看>>
什么是 ROC AUC
查看>>
Bagging 简述
查看>>
详解 Stacking 的 python 实现
查看>>
简述极大似然估计
查看>>
用线性判别分析 LDA 降维
查看>>
用 Doc2Vec 得到文档/段落/句子的向量表达
查看>>
使聊天机器人具有个性
查看>>
使聊天机器人的对话更有营养
查看>>
一个 tflearn 情感分析小例子
查看>>
attention 机制入门
查看>>
手把手用 IntelliJ IDEA 和 SBT 创建 scala 项目
查看>>
GAN 的 keras 实现
查看>>
AI 在 marketing 上的应用
查看>>
Logistic regression 为什么用 sigmoid ?
查看>>
Logistic Regression 为什么用极大似然函数
查看>>
SVM 的核函数选择和调参
查看>>
LightGBM 如何调参
查看>>
用 TensorFlow.js 在浏览器中训练神经网络
查看>>