On my case, it might be related with not very well supported libraries I have on my project and that are not necessarily updated, also don’t have Kotlin support. Anyway, when I checkout commits previous to this change, everything compiles properly and class R is generated.
But this libraries are absolutely essential to my project and the work the creators of this libraries have been awesome, Hope this can help and give some clues to solve this issue.