How to replace strings resources with Android Gradle

前端 未结 4 952
感动是毒
感动是毒 2020-12-07 23:45

I made a new app with gradle in Android Studio, and now I need to make about 10 versions with different package names and values in resources. I made custom flavors as in ex

4条回答
  •  臣服心动
    2020-12-08 00:10

    In your "src" folder, create "flavor1" and "flavor2" folders with the same hierarchy as your "main" folder. If you have strings.xml in your main/res/values, you can do it in flavor1/res/values as well and have the replacement values in there. It may show errors in the IDE but it should still build and run.

提交回复
热议问题