Many thanks - I knew it must be something very basic.
It was very confusing that it was working when called from another point in the code - some piece of code, perhaps reverse geocoding, must have been loading the library under the covers since I certainly didn't!
BTW The reason for using DistanceBetween is that the 'equals' function of the LatLng object is too precise, for my purposes within 100m is the same place and for some applications within a few miles is close enough. It would be nice if the the equals function took an optional 2nd parameter to indicate the acceptable accuracy for the comparison. e.g. if (a.equals(b,100)) ...