AS升级到3.4.2之后在多渠道环境下编译出错,错误提示为:"ERROR: All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html,Affected Modules: ModuleName".
错误:要求所有的flavors要在同一个维度。
解决办法:在build.gradle文件defaultConfig下添加:
compileSdkVersion 22
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.kyunglip"
minSdkVersion 17
targetSdkVersion 19
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
//buildConfigField 默认值,特殊渠道属性可以重写
buildConfigField "Boolean ", "SPEECH_ENABLED", "true"
ndk {
abiFilters 'armeabi-v7a'
}
//添加此行
flavorDimensions "default"
}
其中,“default"值可以是任意,但一般都是default。添加完之后重新syn。
|