The solution didn’t help me because I was using jetpack version ie androidx. libraries.
Followed official doc.
And
I had to change name to androidx….Multidex.
<application
android:name="androidx.multidex.MultiDexApplication" >
...
</application>
Hope It helps other people looking for adding multidex with jetpack.