Similar to the lexan Z mounts, we have seen success in the past with small aluminum mounts (these fit really nicely in the lightening holes of other parts that are cut on a water jet, which makes for efficient layouts). These can then be secured to the frame with a rubber mount which can be purchased from McMaster
here.
As for the shaft of the encoder we simply drill the appropriate hole in the shaft (haven't always reamed the hole) and secure it with some loctite 680 (which has a diametrical clearance max of 0.015" so your hole doesn't need to be all that precise). Takes a heat gun to remove it, but luckily none of the defenses this year involved a heat gun, so the encoders stayed put.
We made this our standard method of mounting encoders and potentiometers in 2015. The rubber mounts allow for some give, allowing some misalignment, but are quite rigid which I would imagine eliminates the issues seen with latex tubing used as a coupler.
~DK
