I'm having trouble understanding build variants in Android studio. I created an empty project and added product flavors as follows.
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
flavorDimensions "version"
productFlavors {
demo {
applicationIdSuffix ".demo"
}
full {
applicationIdSuffix ".full"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
I synced the project with Gradle files and I only get a demo debut variant. As per my understanding, I should get,
- demoDebug
- demoRelease
- fullDebug
- fullRelease
Am I following anything wrong? Any help is greatly appreciated.
Specify the dimension for each flavor in the flavor block like this