0

I am making an instant app. I have the base feature and the installed module. The two gradle files can't have a defaultConfig{}, so that is why I have set multiDex true only in the installed build.gradle file. Running the instant app though throws a compile error as there is no multiDex anywhere.

Any ideas? Thanks.

L4ry
  • 77
  • 9

1 Answers1

1

The Solution lies within making two flavours in base.gradle:

flavorDimensions 'delivery'
productFlavors {
    instant {
        dimension 'delivery'
        minSdkVersion rootProject.minSdkInstant
        multiDexEnabled true
    }
    installed {
        dimension 'delivery'
    }
}

Note: you still have to add multiDexEnabled true in installed.gradle's defaultConfig{} Also put missingDimensionStrategy 'delivery', 'installed' in installed.gradle'sdefaultConfig{} and missingDimensionStrategy 'delivery', 'instant' in instant.gradle's defaultConfig{}