java 是否可以在 eclipse 中更改 android 项目上的包名称?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5251942/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to change package name on android project in eclipse?
提问by Ted pottel
the package name for my project is org.consulting.keno
, could I change it somehow to something like org.consulting.keno2
?
我的项目的包名称是org.consulting.keno
,我可以将其更改为类似的名称org.consulting.keno2
吗?
The problem is that I submitted an app to the google store as free and want to change it to charge money. The google store said I would have to remove the old one and re-submit a new apx file. But I get a error saying conflicting package name.
问题是我向谷歌商店免费提交了一个应用程序,并想将其更改为收费。谷歌商店说我必须删除旧的并重新提交一个新的apx文件。但是我收到一条错误消息,说包名冲突。
回答by erdomester
I would like to complete Mef's answer. In a lot of cases this solution is not enough, cause not all the package name references in the manifest are changed and some other issues may appear. The three step solution is as below:
我想完成 Mef 的回答。在很多情况下,这种解决方案是不够的,因为清单中的所有包名称引用都没有被更改,并且可能会出现一些其他问题。三步解决方案如下:
- Right click on the package name then Refract > Rename.
- Right click on the project name Android tools > Rename Application Package.
- Manually set the package names of the Manifest that have not been changed by the previous steps.
- 右键单击包名称,然后 Refract > Rename。
- 右键单击项目名称 Android 工具 > 重命名应用程序包。
- 手动设置前面步骤没有改变的Manifest的包名。
Looks like it does not need any cleaning or resetting of the IDE (I am using Eclipse).
看起来它不需要对 IDE 进行任何清理或重置(我使用的是 Eclipse)。
回答by Leo
Inside the package explorer, right click on the package and chose
在包浏览器中,右键单击包并选择
Refactor > Rename
Type in the new name and you are done.
输入新名称即可完成。
回答by Sunday G Akinsete
Simply select the package name and press F2. Rename to what you want. Then open the gen folder then rename the package there as well.
只需选择包名称并按 F2。重命名为你想要的。然后打开 gen 文件夹,然后在那里重命名包。
And don't forget to change the package name in the AndroidManifest.xml file as well
并且不要忘记更改 AndroidManifest.xml 文件中的包名