問題描述
當我嘗試調試我的 android 應用程序時,我收到以下錯誤消息:
When i'm trying to debug my android app i'm getting the following error message:
錯誤:任務執行失敗':app:transformClassesWithDexForDebug'.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:進程'命令'/庫/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java''以非零退出值 2 結束
com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
錯誤首先出現在添加新依賴項時.這是我的 gradle 文件
The error first appeared on adding a new dependency. This is my gradle file
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.google.dagger:dagger:2.0.1'
apt 'com.google.dagger:dagger-compiler:2.0.1'
provided 'javax.annotation:jsr250-api:1.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'de.greenrobot:eventbus:2.4.0'
// Icepick
compile 'frankiesardo:icepick:3.1.0'
provided 'frankiesardo:icepick-processor:3.1.0'
// Mosby
compile 'com.hannesdorfmann.mosby:mvp:2.0.0'
compile 'com.hannesdorfmann.parcelableplease:annotation:1.0.1'
apt 'com.hannesdorfmann.parcelableplease:processor:1.0.1'
compile 'com.ogaclejapan.smarttablayout:library:1.4.2@aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.4.2@aar'
compile 'com.ogaclejapan.smarttablayout:utils-v13:1.4.2@aar'
當我嘗試使用 smarttablayout 時出現錯誤.使用 gradle 1.4 版本.有誰知道怎么回事?
The error appears when i'm trying to use the smarttablayout. Using the gradle 1.4 Version. Does anybody know what is wrong?
推薦答案
昨天剛遇到這個問題.我通過手動刪除 build/
和 app/build/
文件夾并再次構建項目來修復它.
Just had the issue yesterday. I fixed it by manually removing the build/
and app/build/
folders, and by building the project again.
但它也可能來自其他東西,比如您的應用達到 65k 方法限制(在什么情況下)案例使用 Gradle 為 Multidex 配置您的應用程序"將解決您的問題).因此,您需要提供完整的 Gradle 日志,以便我們能夠更詳細地檢查問題可能是什么.
But it also might come from something else like your app reaching the 65k methods limit (in what case "Configuring Your App for Multidex with Gradle" will fix your issue). So you will need to provide the full Graddle log for us to be able to check more in detail what the issue could be.
這篇關于Android Studio:意外的頂級異常(以非零退出值 2.. 結束)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!