How to change package name of an Android Application

后端 未结 18 1277
攒了一身酷
攒了一身酷 2020-11-28 02:07

My keystore is corrupt, therefore the Android Market is requiring me to rename the app and resubmit it. However, whenever I go to edit the package names in Manifest and thro

18条回答
  •  难免孤独
    2020-11-28 02:19

    The fastest way to do that in Android Studio 1.3:

    1. Change the package name in the manifest
    2. Go to Module Settings[F4]-> Flavors, into Application Id write the same name.
    3. Create new package with that name: [right-click-> new-> package]
    4. Select all java files of your project and then proceed [Right-click-> Refactor-> Move-> {Select package}-> Refactor]

    P.S. If you will not follow this order you can end up changing all the java files one by one with new imports and a bunch of compile time errors, so the order is very important.

提交回复
热议问题