If you are here and the above solutions did not work for you, then please check if your newly defined custom class has blank lines after its definition - it needs those lines to work.
if it looks like below, it won't work