I could be that the encoder is slipping on the shaft, a drop of contact glue will do the trick than. This slipping is a common problem even when it is not cracked.
You can also buy a new encoder wheel:
https://www.shapeways.com/product/4FDSWS6CS/encoder-g25-g27-60-slot
you can get this printed version or a brass version:
http://cmlaserservice.com/page_g25_g27_optical_encoder_wheel.html
I opted for the printed one because it is cheaper and I don't have to wait a half a year for it to ship out to me. (to be fair, they didn't have any in stock back then. I don't know about now)
It printed one worked great for me, it shipped within a week and I'm using it now for over 2 years without any problems.
This guy sells 30 and 60 slot versions
60 slot is for G25 and early G27 later G27 wheels use the 30 slot version.