Android Studio:意外的顶级异常(以非零退出值 2.. 结束)

Android Studio: Unexpected top level exception (finished with non-zero exit value 2..)(Android Studio:意外的顶级异常(以非零退出值 2.. 结束))
本文介绍了Android Studio:意外的顶级异常(以非零退出值 2.. 结束)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

当我尝试调试我的 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.. 结束)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Android release APK crash with java.lang.AssertionError: impossible in java.lang.Enum(Android 发布 APK 因 java.lang.AssertionError 崩溃:在 java.lang.Enum 中不可能)
Finished with Non Zero Exit Value 3(以非零退出值 3 结束)
On gradle:3.0.0 More than one file was found with OS independent path #39;META-INF/ASL2.0#39;(在 gradle:3.0.0 上找到多个文件,其独立于操作系统的路径为“META-INF/ASL2.0)
Android : app loading library at runtime on Lollipop but not IceCreamSandwich(Android:运行时在 Lollipop 上而不是 IceCreamSandwich 上的应用程序加载库)
buildConfigField depending on flavor + buildType(buildConfigField 取决于风味 + buildType)
How do I suppress warnings when compiling an android library with gradle?(使用 gradle 编译 android 库时如何抑制警告?)