My Android Studio project recently stopped building properly. I do not know what caused this issue.
3.1.0-alpha2
and build tools version 26.0.2
. I tried manyI think I actually changed everything back to the settings I used successfully before and my other projects with similar settings just build fine.
Error:java.lang.RuntimeException: com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {@...\app\build\intermediates\tmp\desugar_args165654356027684238}
Error:com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {@...\app\build\intermediates\tmp\desugar_args165654356027684238}
Error:java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {@...\app\build\intermediates\tmp\desugar_args165654356027684238}
Error:java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {@...\app\build\intermediates\tmp\desugar_args165654356027684238}
Error:com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {@...\app\build\intermediates\tmp\desugar_args165654356027684238}
Error:org.gradle.process.internal.ExecException: Process 'command '...\jre\bin\java.exe'' finished with non-zero exit value 1
I have no clue what could (have) cause(d) this issue and I am clueless about what to try next, which is the reason why I am asking you for help. I hope anyone has any other help than what I could find.
I tagged Firebase because I think that the library might be the crucial point of my problem, now the problem is that it will never explain the sudden stop. I use FirebaseUI
in my application and tried the old working dependencies, but also upgrading Firebase and then using this guide to match the outdated UI library. I also removed FirebaseUI, but this did neither make a successful build.
For me, it happened to be the version of the Leanplum library I was using — although I was unable to surface the error through gradle, I got annoyed enough to find the Desugar sources in the bazel, build it, and then copy the command line arguments from my failing gradle build, which led me to the Leanplum jar, which appeared to have a name collision between two different obfuscated elements:
Exception in thread "main" java.lang.IllegalStateException: Already recorded as class: com/leanplum/a/x
at com.google.common.base.Preconditions.checkState(Preconditions.java:582)
at com.google.devtools.build.android.desugar.ClassVsInterface.addKnownInterfaces(ClassVsInterface.java:46)
at com.google.devtools.build.android.desugar.InterfaceDesugaring.visit(InterfaceDesugaring.java:96)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:621)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
I think this worked for me because the newer version of Desugar has better error reporting... So if like me you are unable to figure out what's going on, it's possible that
bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:Desugar
), path/to/your/built/Desugar --verbose --input /Users/you/yourApp/app/build/intermediates/transforms/stackFramesFixer/envDev/debug/109.jar .... --desugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes
)I was expecting to have to add my own error logging to Desugar to catch this, but happily enough that was unnecessary.
In my case it was the java version which was causing the issue. The error started coming when i added an SDK jar in libs and I got to know the SDK is not compatible with our java version 1.8. Solved with updated SDK jar with java 8.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With