xamarin / java.interop

Java.Interop provides open-source bindings of Java's Java Native Interface (JNI) for use with .NET managed languages such as C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to parse Kotlin Metadata from DTDAnalytics-2.3.3.aar

jonpryor opened this issue · comments

Download: https://github.com/devtodev-analytics/android-sdk-2.0/blob/ce131e63414d7e6e870c7276c67636fdcfbbd2eb/DTDAnalytics-android%202.3.3/DTDAnalytics-2.3.3.aar

Extract classes.jar:

unzip DTDAnalytics-2.3.3.aar classes.jar

Run class-parse against classes.jar, and look at the warnings:

% dotnet class-parse.dll classes.jar
class-parse: warning: Unable to parse Kotlin metadata on 'Utf8("com/devtodev/analytics/external/DTDLogLevel")': System.FormatException: The input string '' was not in a correct format.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, ReadOnlySpan`1 value, TypeCode type)
   at System.Int32.Parse(String s)
   at Xamarin.Android.Tools.Bytecode.KotlinMetadata.ParseInteger(String value) in …/xamarin/Java.Interop/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinMetadata.cs:line 148
   at Xamarin.Android.Tools.Bytecode.KotlinMetadata.<>c.<ParseVersion>b__26_0(String v) in …/xamarin/Java.Interop/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinMetadata.cs:line 122
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at Xamarin.Android.Tools.Bytecode.KotlinMetadata.ParseVersion(Annotation annotation, String key) in …/xamarin/Java.Interop/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinMetadata.cs:line 122
   at Xamarin.Android.Tools.Bytecode.KotlinMetadata.FromAnnotation(Annotation annotation) in …/xamarin/Java.Interop/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinMetadata.cs:line 30
   at Xamarin.Android.Tools.Bytecode.KotlinFixups.Fixup(IList`1 classes) in …/xamarin/Java.Interop/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinFixups.cs:line 23
# plus 141 similar warnings

Looks like bv is empty:

{Annotation('Lkotlin/Metadata;', {mv: [1, 6, 0], bv: [], k: 1, d1: ["

Apparently Kotlin no longer uses it:

    /**
     * The version of the bytecode interface (naming conventions, signatures) of the class file annotated with this annotation.
     */
    @Deprecated(
        "Bytecode version had no significant use in Kotlin metadata and it will be removed in a future version.",
        level = DeprecationLevel.WARNING,
    )
    @get:JvmName("bv")
    val bytecodeVersion: IntArray = [1, 0, 3],

(Source)

I guess we can just silently ignore it.