Home » Android » android – Can't find referenced class kotlin.internal.annotations.AvoidUninitializedObjectCopyingCheck

android – Can't find referenced class kotlin.internal.annotations.AvoidUninitializedObjectCopyingCheck

Posted by: admin May 14, 2020 Leave a comment

Questions:

When ProGuard is enabled for an Android project with Kotlin, the Gradle build fails with the following error:

Warning: HomeChargerLocation: can’t find
referenced class
kotlin.internal.annotations.AvoidUninitializedObjectCopyingCheck

Warning: HomeChargerLocation$Address:
can’t find referenced class
kotlin.internal.annotations.AvoidUninitializedObjectCopyingCheck

Warning: HomeChargerLocation$Address$Creator:
can’t find referenced class
kotlin.internal.annotations.AvoidUninitializedObjectCopyingCheck

Warning: HomeChargerLocation$Car: can’t
find referenced class
kotlin.internal.annotations.AvoidUninitializedObjectCopyingCheck

Warning:
HomeChargerLocation$Car$Creator: can’t
find referenced class
kotlin.internal.annotations.AvoidUninitializedObjectCopyingCheck

Warning: HomeChargerLocation$Creator:
can’t find referenced class
kotlin.internal.annotations.AvoidUninitializedObjectCopyingCheck

Warning: Exception while processing task java.io.IOException: Please
correct the above warnings first.

The corresponding classes: https://gist.github.com/makovkastar/cfa4bf1bea38556279f20eef46001cf8

I assume it has something to do with the @Parcelize annotation from the Kotlin experimental package, because the problem appeared when we started using it.

UPDATE: I have created an issue in the Kotlin bug tracker –
https://youtrack.jetbrains.com/issue/KT-21628

How to&Answers:

The issue has been fixed in Kotlin 1.2.20.