When I ran my app, it said that
Cannot Instant Run: legacy multi-dex on Dalvik runtime
Does it means that I can't use Instant Run when I use multi-dex?
I'm using Android Studio beta4.
In order to activate multiDex at old android versions you have to set multiDexEnabled to true, add dependency and extend your application class from MultiDexApplication or launch MultiDex.install(this) in your application class, which will cause legacy multiDex installation.
However since Intant Run can't work with legacy multiDex you have to use normal one. All you need is removing all that code above except of multiDexEnabled flag set to true. This method is only supported by devices with API 21 and above.
Feel free to correct me if something is wrong.
As mentioned in the documentation Instant Run is disabled by Android Studio in case multidex is enabled for API level 20 or lower and app is deployed on API level 20 or lower.
Documentation link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With