Java finished with non-zero exit value 2 - Android Gradle

前端 未结 23 2283
甜味超标
甜味超标 2020-11-22 02:54

I\'m getting this error executing my Android app (I cleaned it and then built it, but the error is still present)

  • Sync: OK
  • Make Project: OK
23条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 03:03

    My problem was that apart from having

    com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.X.X_XX.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

    I had this trace as well:

    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/mypackage/ClassX;

    The problem was that I was adding the same class in two differents libraries. Removing the class/jar file from one of the libraries, the project run properly

提交回复
热议问题