# serialization


02/06/2023, 8:32 AM
I had some manual serializers written for some Groovy classes of a library. Now this library ported their code over to Kotlin. I adapted the serializers to the changes like some new fields on the way and some nullability changes. But now I get on the
@Serializer(forClass = ...)
Copy code
Cannot generate external serializer 'FooSerializer': class 'Foo' is defined in another module
😞 Anything I can do about that?
how many classes do you want to handle?


02/06/2023, 10:41 AM
Seven. But actually it seems to be a false-positive in the IDE. It actually works fine.
Maybe because the IDE plugin is 1.8.0 but it is in an 1.7.20 project unless Gradle updates the embedded Kotlin to 1.8
The issue you link to seems to be unrelated also, it is a completely different message than what IntelliJ says and that also happens with the serializer in the same module and also it is about automatic external serializers while I have a manual custom serializer.
Ok, forget it, the
@Serializer(forClass = ...)
annotations were superfluous anyway. No idea why I added them back then. But as I do complete manual serializer, they have no effect anyway as far as I understood. I just removed them and it still works perfectly fine. 🙂
Thanks for being my rubber duck 🙂

Adam S

02/06/2023, 11:21 AM
ahh okay, good you found it, and my pleasure rubber duck
it was this comment that caught my eye in the issue I linked
External automatic serializers generation is in many ways experimental feature for now, and due to its complexity, it has many bugs beside this one.