1. 程式人生 > >Android Studio BUILD FAILED finished with non-zero exit value

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