versionNameSuffix在Android studio 4.1.0中不起作用

versionNameSuffix在Android studio 4.1.0中不起作用,android,android-studio,android-gradle-plugin,build.gradle,Android,Android Studio,Android Gradle Plugin,Build.gradle,正如您所知,gradle stopped()在gradle DSL中支持VERSION_代码和VERSION_名称。有关更多信息,请单击。因此,我添加了以下代码(app build.gradle): 我的问题是:如何修复versionNameSuffix方法,因为它不工作 defaultConfig { versionCode 1 versionName "1.0" buildConfigField 'int'

正如您所知,gradle stopped()在gradle DSL中支持VERSION_代码和VERSION_名称。有关更多信息,请单击。因此,我添加了以下代码(app build.gradle):

我的问题是:如何修复versionNameSuffix方法,因为它不工作

        defaultConfig {
        versionCode 1
        versionName "1.0" 
        buildConfigField 'int', 'VERSION_CODE', "1"           //fix issue
        buildConfigField 'String', 'VERSION_NAME', "\"1.0\"" //fix issue
        }
//..
        buildTypes {
             debugToast{
               versionNameSuffix "-debug(Toasts)" //NOW DOES NOT WORK !!
             }
        }
//..