how to change android app name in the build gradle file

后端 未结 5 1647
没有蜡笔的小新
没有蜡笔的小新 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 08:16

    Actually... For a more definitive explanation;

    In main build.gradle :

    ext {
        APP_NAME = "My Fabulous App"
        APP_NAME_DEBUG = "My Fabulous App debug"
    }
    

    In app build.gradle :

    android {
        buildTypes {
            debug {
                manifestPlaceholders = [appName: APP_NAME_DEBUG]
            }
            release {
                manifestPlaceholders = [appName: APP_NAME]
            }
        }
    }
    

    so in AndroidManifest.xml

    
    

    is possible. Voilà! you have different application names for release and debug.

提交回复
热议问题