Android gradle buildTypes: Duplicate class

后端 未结 2 1116
余生分开走
余生分开走 2020-12-28 14:00

I\'m converting my app to use gradle, and I\'m trying to use the buildTypes. I have a Constants class which I wish to modify for my release build. So I have a f

2条回答
  •  余生分开走
    2020-12-28 14:37

    The answer from "fix" helped me on the way, but I got an error from the main Gradle, saying a constant was missing (in my class Config). This since I had my class only in paid and free version and not in main. Could not find the Config class. Im not sure if this is a bug in Studio... I finally solved it with the following:

    buildTypes {
    
        release {
            ...
            buildConfig "public static final boolean XYZ = false;"
        }
    
    }
    

    And the instead of using my Config.XYZ class constant I used buildConfig.XYZ

提交回复
热议问题