我在Android Studio中理解构建变体方面遇到了困难。我创建了一个空项目,并添加了如下的产品风味。
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'
}
我已经将项目与Gradle文件同步,但只获得了演示版的变体。根据我的理解,我应该获得以下变体:
- demoDebug - demoRelease - fullDebug - fullRelease 请问我有什么做错了吗?非常感谢您的帮助。