我能够在Android Studio v3.2.1中将构建变体更改为devDebug,devRelease,playStoreDebug,playStoreRelease,并且在更新至v3.3.1之后,我无法更改构建变体参考图像Image_In_Android_studio_3.3.1。
在将问题发布到此处之前,我尝试了以下步骤:- 1.清理项目/重建/使缓存无效并重新启动项目 2.重新克隆存储库(因为它与现有存储库不兼容)。
build.gradle版本1
signingConfigs {
release {
storeFile file("$project.rootDir/xyz-keystore-release.jks")
storePassword “xyzzy”
keyAlias "xyzzy"
keyPassword "xyzzy"
}}
buildTypes {
release {
minifyEnabled false
shrinkResources false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}}
productFlavors {
playStore {
applicationId myApplicationId
manifestPlaceholders = [crashlyticsEnabled: true]
}
dev {
applicationId myApplicationId + ".dev"
manifestPlaceholders = [crashlyticsEnabled: false]
}}
build.gradle版本2
signingConfigs {
release {
storeFile file("$project.rootDir/xyz-keystore-release.jks")
storePassword “xyzzy”
keyAlias "xyzzy"
keyPassword "xyzzy"
}
debug {
storeFile file("$project.rootDir/xyz-debug.keystore")
storePassword "xyzzy"
keyAlias "xyzzy"
keyPassword "xyzzy"
}}
buildTypes {
release {
minifyEnabled false
shrinkResources false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
minifyEnabled false
shrinkResources false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}}
productFlavors {
playStore {
applicationId myApplicationId
manifestPlaceholders = [crashlyticsEnabled: true]
}
dev {
applicationId myApplicationId + ".dev"
manifestPlaceholders = [crashlyticsEnabled: false]
}}
使用Android Studio v3.2.1中的“ build.gradle版本1”,我能够更改构建变体,更新到Android Studio v3.3.1后,我无法更改。