If a crabapple fails to produce fruit, but does have flowers, then either flowers were not pollinated or the tree has other issues and is stressed, and will then abort fruit. Crabapple trees in shade also tend to produce little to no fruit.
-Pamm Cooper