NoSuchMethodError: No virtual method getDeclaredAnnotation on Android API level <24
See original GitHub issueDescribe the bug
java.lang.NoSuchMethodError: No virtual method getDeclaredAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation; in class Ljava/lang/Class; or its super classes (declaration of 'java.lang.Class' appears in /system/framework/core-libart.jar)
at kotlinx.serialization.internal.PlatformKt.polymorphicSerializer(Platform.kt:70)
at kotlinx.serialization.internal.PlatformKt.constructSerializerForGivenTypeArgs(Platform.kt:53)
at kotlinx.serialization.internal.PlatformKt.compiledSerializerImpl(Platform.kt:23)
at kotlinx.serialization.SerializersKt__SerializersKt.serializerOrNull(Serializers.kt:129)
at kotlinx.serialization.SerializersKt.serializerOrNull(Unknown Source)
at kotlinx.serialization.SerializersKt__SerializersKt.serializerByKTypeImpl$SerializersKt__SerializersKt(Serializers.kt:65)
at kotlinx.serialization.SerializersKt__SerializersKt.serializer(Serializers.kt:51)
at kotlinx.serialization.SerializersKt.serializer(Unknown Source)
at kotlinx.serialization.SerializersKt__SerializersKt.builtinSerializerOrNull$SerializersKt__SerializersKt(Serializers.kt:76)
at kotlinx.serialization.SerializersKt__SerializersKt.serializerByKTypeImpl$SerializersKt__SerializersKt(Serializers.kt:66)
at kotlinx.serialization.SerializersKt__SerializersKt.serializer(Serializers.kt:51)
at kotlinx.serialization.SerializersKt.serializer(Unknown Source)
at com.example.myapplication.MainActivity.onCreate(MainActivity.kt:17)
To Reproduce On Android API level <24:
Json.decodeFromString<List<Int>>("[0,1,2,3]")
Environment
- Kotlin version: 1.4.0
- Library version: 1.0.0-RC
- Kotlin platforms: JVM (Android)
- Gradle version: 6.1.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:9 (4 by maintainers)
Top Results From Across the Web
No virtual method contains(I)Z in class Landroid/util ...
NoSuchMethodError : No virtual method contains(I)Z in class Landroid/util/SparseArray; ; class PostViewFragment : DialogFragment() { private var ...
Read more >Class - Android Developers
Class has no public constructor. Instead Class objects are constructed automatically by the Java Virtual Machine as classes are ... Added in API...
Read more >Seemingly random "NoSuchMethodError: No virtual method"
During runtime, some function will throw a 'NoSuchMethodError' despite it clearly existing in the codebase. It seems to happen to completely random ...
Read more >No virtual method elapsedNow()D in class Lkotlin ... - YouTube
Android : java.lang. NoSuchMethodError : No virtual method elapsedNow()D in class Lkotlin/time/TimeMark [ Beautify Your Computer ...
Read more >Android crash due to "No virtual method ... - Wikitude
NoSuchMethodError : No virtual method ... handleCallback(Handler.java:873) at android.os.Handler. ... Method.invoke(Native Method) at com.android.internal.os.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@webfrea-k We plan to release RC2 with this fix soon
~this week