Append the following version variable definitions to your app's build.gradle file, this can be anywhere but preferably at the top of the file above all "apply" declarations. You may set the values to your current build/version codes if this is not a new project.
def VERSION_BUILD=0
def VERSION_MAJOR=0
def VERSION_MINOR=0