Search code examples
androidandroid-studiogradleandroid-productflavors

Android ProductFlavor name 'plus' doesn't work


I try to create two different product flavors for my app. One normal flavor for a free version and one flavor called "plus" for a paid version. I tried to create these flavors with the following code in my build.gradle

productFlavors {
    normal {}
    plus {
        applicationIdSuffix '.plus'
        versionNameSuffix '-plus'
    }
}

Then I noticed that after I synced everything I just saw normalDebug and normalRelease in my buildVariants. I struggled around and just found out as soon as I add any character to plus and sync again it works. So things like plusx work and show all the buildVariants in Android Studio. I couldn't find out why the simple word plus doesn't work. Does anyone know about it and is there a way to use plus as name for my product flavor?


Solution

  • As @CommonsWare wrote plus might be a Groovy keyword or something else. I came across the possibility to use a capital letter like Plus. This works as expected.