Android Question Help request for desugaring a library

drgottjr

Expert
Licensed User
Longtime User
something fishy about this one, i think. i've used erel's desugarer a few times without incident. (i just tried a file i had to make sure i wasn't missing something. it desugared find.) your classes.jar file, however, caused a lot of commotion:

C:\Users\new\Desktop\DESUGAR>java -jar Desugar_deploy.jar --bootclasspath_entry=
"C:\Android\platforms\android-29\android.jar" --input=classes.jar --output=desu
gared.jar
Exception in thread "main" java.lang.NoClassDefFoundError: androidx/lifecycle/An
droidViewModel
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at com.google.devtools.build.android.desugar.io.HeaderClassLoader.findCl
ass(HeaderClassLoader.java:67)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at com.google.devtools.build.android.desugar.io.HeaderClassLoader.findCl
ass(HeaderClassLoader.java:67)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.google.devtools.build.android.desugar.LambdaDesugaring.loadFromIn
ternal(LambdaDesugaring.java:337)
at com.google.devtools.build.android.desugar.LambdaDesugaring.access$500
(LambdaDesugaring.java:56)
at com.google.devtools.build.android.desugar.LambdaDesugaring$Invokedyna
micRewriter.createLookup(LambdaDesugaring.java:620)
at com.google.devtools.build.android.desugar.LambdaDesugaring$Invokedyna
micRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:402)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:2235)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1275)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:679)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInp
ut(Desugar.java:618)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Des
ugar.java:449)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.jav
a:391)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:9
74)
Caused by: java.lang.ClassNotFoundException: Class androidx.lifecycle.AndroidVie
wModel not found
at com.google.devtools.build.android.desugar.io.HeaderClassLoader.findCl
ass(HeaderClassLoader.java:53)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 24 more

C:\Users\new\Desktop\DESUGAR>pause
Press any key to continue . . .

with luck, maybe someone higher up the food chain here will try overnight for you. sorry.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
java -jar Desugar_deploy.jar  --input classes.jar --output=ttt.jar --bootclasspath_entry=C:\Android\platforms\android-30\android.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\lifecycle\lifecycle-viewmodel\2.2.0\unpacked-lifecycle-viewmodel-2.2.0\jars\classes.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\databinding\baseLibrary\3.2.0-alpha11\baseLibrary-3.2.0-alpha11.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\fragment\fragment\1.2.5\unpacked-fragment-1.2.5\jars\classes.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\core\core\1.3.2\unpacked-core-1.3.2\jars\classes.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\activity\activity\1.1.0\unpacked-activity-1.1.0\jars\classes.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\lifecycle\lifecycle-common\2.2.0\lifecycle-common-2.2.0.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\savedstate\savedstate\1.0.0\unpacked-savedstate-1.0.0\jars\classes.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\lifecycle\lifecycle-livedata-core\2.2.0\unpacked-lifecycle-livedata-core-2.2.0\jars\classes.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\lifecycle\lifecycle-runtime\2.2.0\unpacked-lifecycle-runtime-2.2.0\jars\classes.jar --classpath_entry=C:\Android\extras\b4a_remote\androidx\recyclerview\recyclerview\1.1.0\unpacked-recyclerview-1.1.0\jars\classes.jar

I've sent you the jar with an email as it is larger than allowed in the forum.
 
Upvote 0

abilio486software

Active Member
Licensed User
Many thanks Erel ?
Sem Título.png
 
Last edited:
Upvote 0
Top