Issue with Android Library with Proguard Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Issue with Android Library with Proguard without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I am working on an android library project, compiled it without ProGuard.

When I use that library in a project, I get no error, build is successful.

But when the library is compiled using ProGuard, and after using it on a project, I’m getting an error while trying to build the project.

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
Exception in thread “main” java.lang.IllegalStateException: Expected a load for Lcom/yuwee/sdk/YuWeeCallActivity; to set up parameter 0 for com/yuwee/sdk/YuWeeCallActivity$$Lambda$4 but got -1
at com.google.common.base.Preconditions.checkState(Preconditions.java:756)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.attemptAllocationBeforeArgumentLoads(LambdaDesugaring.java:543)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:427)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1623)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1126)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:698)
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)

:app:transformClassesWithDesugarForDebug FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:transformClassesWithDesugarForDebug’.

    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 {–input /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/43.jar –output /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/desugar/debug/13.jar –input /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/0.jar –output /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/desugar/debug/1.jar –input /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/41.jar –output /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/desugar/debug/11.jar –input /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/54.jar –output /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/desugar/debug/24.jar –input /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/32.jar –output /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/desugar/debug/2.jar –input /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/44.jar –output /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/desugar/debug/14.jar –input /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/48.jar –output /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/desugar/debug/18.jar –input /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/34.jar –output /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/desugar/debug/4.jar –input /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/49.jar –output /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/desugar/debug/19.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/classes/debug –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/0.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/32.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/33.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/34.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/35.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/36.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/37.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/38.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/39.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/40.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/41.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/42.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/43.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/44.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/45.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/46.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/47.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/48.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/49.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/50.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/51.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/52.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/53.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/54.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/55.jar –classpath_entry /media/tanay/New Volume/Projects/Office/TestYuWeeDepen/app/build/intermediates/transforms/stackFramesFixer/debug/56.jar –bootclasspath_entry /home/tanay/Android/Sdk/platforms/android-27/android.jar –bootclasspath_entry /home/tanay/Android/Sdk/platforms/android-27/optional/org.apache.http.legacy.jar –bootclasspath_entry /home/tanay/Android/android-studio/jre/jre/lib/resources.jar –bootclasspath_entry /home/tanay/Android/android-studio/jre/jre/lib/rt.jar –bootclasspath_entry /home/tanay/Android/android-studio/jre/jre/lib/jsse.jar –bootclasspath_entry /home/tanay/Android/android-studio/jre/jre/lib/jce.jar –bootclasspath_entry /home/tanay/Android/android-studio/jre/jre/lib/charsets.jar –min_sdk_version 16 –desugar_try_with_resources_if_needed –desugar_try_with_resources_omit_runtime_classes –legacy_jacoco_fix}

Answer

The problem is solved after removing Java 1.8 Support from a library project’s build.gradle.

We are here to answer your question about Issue with Android Library with Proguard - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji