Gradle - declare classes required in the primary DEX file - how to add property multiDexKeepFile?

I have a problem with multidex files. I need to add property multiDexKeepFile in gradle … but i don’t know how to add additional attributes to default configuration.- I have to inform tools that in primary dex files should be all my defined classes in project because my startup class Application now is in second dex files so application can’t start.
I need :
android {
buildTypes {
release {
multiDexKeepFile file ‘multidex-config.txt’

}
}
}

I have got information from this link :
https://developer.android.com/studio/build/multidex.html