How to implement Multi Dex in Instant Apps?

Clash Royale CLAN TAG#URR8PPPHow to implement Multi Dex in Instant Apps?
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.
base feature
installed module
defaultConfig{}
multiDex true
build.gradle
multiDex
Any ideas? Thanks.
1 Answer
1
The Solution lies within making two flavours in base.gradle:
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{}
multiDexEnabled true
installed.gradle
defaultConfig{}
missingDimensionStrategy 'delivery', 'installed'
installed.gradle
defaultConfig{}
missingDimensionStrategy 'delivery', 'instant'
instant.gradle
defaultConfig{}
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.