To activate multiDex in older versions of Android, you must set the value of multiDexEnabled to true, add a dependency and extend the application class from MultiDexApplication or run MultiDex.install (this) in your application class, which will lead to an outdated multiDex installation.
However, since Intant Run cannot work with legacy multiDex, you should use normal. All you need to do is remove all this code except the multiDexEnabled flag set to true. This method is only supported by devices with API 21 and higher.
Feel free to correct me if something is wrong.
Tieru source share