I don't wanna use flavors for this because will give troubles.
I don't think you can do it without productFlavors
. I am leaving this answer here for others who have no issue using productFlavors
.https://developer.android.com/studio/build/multidex.html#dev-build
Basically all you need to do is declare productFlavors
with different minSdkVersion
:
productFlavors { dev { // Enable pre-dexing to produce an APK that can be tested on // Android 5.0+ without the time-consuming DEX build processes. minSdkVersion 21 } prod { // The actual minSdkVersion for the production version. minSdkVersion 14 }}