我有两个风味维度,分期和测试版。我有两种口味的苹果和香蕉。 Apple和Banana具有应用程序使用的不同manifestHolder值。
我的问题是,当我要选择Build变体时,它结合了两种口味。
即使我已经为他们分配了不同的尺寸。
productFlavors {
apple {
dimension "staging"
applicationIdSuffix ".staging"
manifestPlaceholders = [onesignal_app_id : "y",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
banana {
dimension "beta"
applicationIdSuffix ".beta"
manifestPlaceholders = [onesignal_app_id : "x",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
}
答案 0 :(得分:4)
由于$(document).ready(function(){
'use strict';
$('#q').autocomplete({
serviceUrl: "/search/autocomplete/",
minChars: 2,
dataType: 'json',
type: 'GET',
formatResult: function (suggestion, currentValue) {
return '<a href="'+suggestion.url+'"><li class="list-group-item">'+$.Autocomplete.formatResult(suggestion, currentValue) +'</li></a>';
},
});
});
,它结合了两者。
你只需要一个维度。
所以假设你有两个dimension
:
buildTypes
然后针对buildTypes {
debug {
debuggable true
signingConfig signingConfigs.config
}
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
执行以下操作:
productFlavors
这将创建4个最终构建变体:
flavorDimensions "default"
productFlavors {
apple {
dimension "default"
applicationIdSuffix ".staging"
manifestPlaceholders = [onesignal_app_id : "y",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
banana {
dimension "default"
applicationIdSuffix ".beta"
manifestPlaceholders = [onesignal_app_id : "x",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
}
appleDebug
appleRelease
bananaDebug