Rename package in Android Studio

后端 未结 30 2594
深忆病人
深忆病人 2020-11-21 05:21

How do you rename packages in the new IDE Android Studio, based on IntelliJ IDEA?

Is there an automatic refactoring included?

I want to make bulk refactorin

30条回答
  •  深忆病人
    2020-11-21 05:48

    Packages serve two purposes. One is to uniquely identify your app in the Google Play Store. The other is to name the package for the R.java class which is generated when you build your project. You can think of the first purpose as the external package and the second as the internal package. Assuming you want to change the external package so you can identify in the Play store, there's a convenient way to do this.

    In Android Studio,

     choose File -> Project Structure -> Choose your app's module -> Click on the 
     Flavors tab -> change the Application id.
    

    Now, when you build your project, your APK and manifest will use this new package name.

提交回复
热议问题