I'm curious, when is it actually mandatory to use the measure words like buah?
You can omit the classifier here.
Classifiers/counters are mostly used to make it more formal.
In the informal/spoken speech, 'biji' is also used as a classifier for fruit.
'biji' = seed, core of the fruit.