Android Studio build flavors - How to have same source files in diverse flavors

后端 未结 3 1154
后悔当初
后悔当初 2020-12-30 02:51

I need to create a demo flavor in android studio for an app. In my app level gradle file i have created another flavor called demo and the default flavor of full of course.

3条回答
  •  遥遥无期
    2020-12-30 03:27

    I think you can't have same class in main flavor and your other flavor. you should just create another flavor, then move your Hello class from main flavor to that new flavor. this rule is just for .java files. I mean you can have an xml file in main flavor and another version in your custom flavor but you can't do this with java files.

    here is a useful link with further explanation.

提交回复
热议问题