Can I use a kotlin library in AppinventorSources

Can i use a kotlin library in Appinventor sources for a component... If yes how?

I encountered this issue while building my sources with it:-

     [java]
     [java] PARSE ERROR:
     [java] MethodType not supported
     [java] ...while preparsing cst 010a at offset 00000d3b
     [java] ...while parsing io/ak1/BubbleTabBar.class
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.LogFactory$1) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.LogFactory$4) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.LogFactory$2) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.LogFactory$3) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.LogFactory$5) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.LogFactory$6) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.impl.LogFactoryImpl$1) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.impl.LogFactoryImpl$3) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.impl.SimpleLog$1) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.impl.WeakHashtable$1) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] warning: Ignoring InnerClasses attribute for an anonymous inner class
     [java] (org.shaded.apache.commons.logging.impl.LogFactoryImpl$2) that doesn't come with an
     [java] associated EnclosingMethod attribute. This class was probably produced by a
     [java] compiler that did not target the modern .class file format. The recommended
     [java] solution is to recompile the class from source, using an up-to-date compiler
     [java] and without specifying any "-target" type options. The consequence of ignoring
     [java] this warning is that reflective operations on this class will incorrectly
     [java] indicate that it is *not* an inner class.
     [java] 1 error; aborting
     [java] Feb 20, 2022 4:43:39 PM com.google.appinventor.buildserver.Compiler setProgress
     [java] INFO: The current progress is 75%
     [java] Feb 20, 2022 4:43:39 PM com.google.appinventor.buildserver.Compiler runMultidex
     [java] INFO: DX time: 26.302000 seconds
     [java] Feb 20, 2022 4:43:39 PM com.google.appinventor.buildserver.Compiler runMultidex
     [java] WARNING: YAIL compiler - DX execution failed.

BUILD FAILED
E:\appinventor-sources\appinventor\build.xml:21: The following error occurred while executing this line:
E:\appinventor-sources\appinventor\buildserver\build.xml:199: Java returned: 1

Any help will be appreciated

most probably problem with jar encoding

1 Like

Any solution for the same?

It looks like your library is using newer JVM features than our version of dx from the Android library supports. You might be able to use a desugaring tool to make it compatible with the older dx utility.

1 Like