OK, I've solved it. Error 6 isn't coming from LicenceValidator, it's coming from LicenseChecker and indicates that a permission is missing. I hadn't given the app com.android.vending.CHECK_LICENSE permission. When I did, it started working.
Thanks for your interest and I hope this helps anyone who makes the same mistake.