how to change android app name in the build gradle file

后端 未结 5 1648
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 07:28

I\'m creating different flavors using gradle for 2 small android apps ,i wanna just know if i can edit app name on the xml file in the build.gradle , for my different flav

5条回答
  •  滥情空心
    2021-01-03 07:58

    You can use resValue, eg.

    debug {
        resValue 'string', 'app_name', '"MyApp (Debug)"'`
    }
    release {
        resValue 'string', 'app_name', '"MyApp"'
    }
    

    Make sure your AndroidManifest uses android:label="@string/app_name" for the application, and remove app_name from strings.xml as it will conflict with gradle's generated strings.xml when it tries to merge them.

提交回复
热议问题