Unable to parse Kotlin Metadata from DTDAnalytics-2.3.3.aar
jonpryor opened this issue · comments
Jonathan Pryor commented
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
Jonathan Pobst commented
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],
I guess we can just silently ignore it.