-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type fyi.fax.klassindex.SubclassIndex is defined multiple times #65
Comments
Thanks for reporting this and providing me with a source. I will investigate it. |
Any idea how to fix this? I'm thinking it might be better to not provide those placeholder classes that cause the conflict. Actually, I think we could even direct people to use the generated classes directly and not provide the |
I think the issue was that the placeholder class is necessary for compile time or at least IDE checks to not complain about the missing class. I'm hoping that ksp will make this redundant, so that generated classes are properly recognized without a placeholder, eliminating the minimization conflict from R8. Btw, if the generated classes are in the class index with the newer Gradle versions, there's no need to include the There might be other workarounds with Gradle, to manually delete the placeholders at the right time so that the IDE relies on the placeholder while R8 is only presented with the generated index class. I'm about halfway through the ksp migration. The end of next week will be a convenient time to return to this. |
I've ended up building an alternative with KSP support and without the need of the runtime library part: https://github.com/albertvaka/classindexksp Feel free to copy-paste as much as you want if you decide to add KSP support to KlassIndex :) |
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#98The text was updated successfully, but these errors were encountered: