Avro.avroexception: genericrecord required to write against record schema but found avro.generic.genericrecord

Please help to solve this issue.

https://stackoverflow.com/questions/67469448/avro-avroexception-genericrecord-required-to-write-against-record-schema-but-fo