I have entered a post on StackOverflow here that describes the issue in detail, including stack traces from running gradlew from the command line and posting the stack trace to pastebin.
Essentially, the problem is that on an incremental build I am getting a kotlin null pointer error, the relevant aspect of the stack trace is:
Caused by: kotlin.KotlinNullPointerException
at io.realm.processor.ModuleMetaData.getClassListFromModule(ModuleMetaData.kt:337)
at io.realm.processor.ModuleMetaData.validateNamingPolicies(ModuleMetaData.kt:170)
at io.realm.processor.ModuleMetaData.preProcess(ModuleMetaData.kt:113)
at io.realm.processor.RealmProcessor.preProcessModules(RealmProcessor.kt:241)
at io.realm.processor.RealmProcessor.process(RealmProcessor.kt:178)
I am using 10.4.0 annotations processor, which I believe is the latest (also that version of the SDK).