matfax / klassindex

Index Kotlin classes at compile time as if they were statically referenced.
Apache License 2.0
7 stars 0 forks source link

Type fyi.fax.klassindex.SubclassIndex is defined multiple times #65

Open albertvaka opened 1 month ago

albertvaka commented 1 month ago

I get this error when building https://github.com/KDE/kdeconnect-android/

One definition seems to be in the library-4.1.0.jar:fyi/fax/klassindex/SubclassIndex.class and the other in build\intermediates\classes\release\transformReleaseClassesWithAsm\dirs\fyi\fax\klassindex\SubclassIndex.class

I see that the second instance (generated) is meant to override the first (bundled, throws AnnotationNotProcessedException if used) but for some reason gradle is not overriding them, just failing.

Any idea what could be causing this?

Edit: This error is printed in the minifyReleaseWithR8 step of the build, so when the minification happens. If I disable minification, it works.

Edit 2: I found the code of R8 where the defined multiple times error is thrown: https://r8.googlesource.com/r8/+/refs/heads/main/src/main/java/com/android/tools/r8/utils/ProgramClassCollection.java#98

matfax commented 1 month ago

Thanks for reporting this and providing me with a source. I will investigate it.