How to change package name of an Android Application

后端 未结 18 1272
攒了一身酷
攒了一身酷 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:20

    If you're using Eclipse, you could try these instructions from Android's developer site. They're specifically for the GestureBuilder sample but should apply to any application as far as I can tell:

    [H]ere's how you could do this in Eclipse:

    1. Right-click on the package name (src/com.android.gesture.builder).
    2. Select Refactor > Rename and change the name, for example to com.android.gestureNEW.builder.
    3. Open the manifest file. Inside the tag, change the package name to com.android.gestureNEW.builder.
    4. Open each of the two Activity files and do Ctrl-Shift-O to add missing import packages, then save each file. Run the GestureBuilder application on the emulator.

    Also, be sure you remembered to rename the package itself along with the references to it in the files. In Eclipse you can see the name of the package in the file explorer window/tree view on the left hand side. In my experience, Eclipse can sometimes be a little finnicky and unreliable with this (leaving behind stray references to the old package name, for example).

提交回复
热议问题