简体   繁体   English

在Android Studio中发布重命名包

[英]issue renaming package in android studio

I'm trying to rename my app package name in android studio because when I try to upload to google play it says prefix "com.example" is reserved. 我尝试在android studio中重命名我的应用包名称,因为当我尝试将其上传到Google Play时,它说前缀“ com.example”已保留。 So I've been to manifest file - double click in "example" and then refractor this, changed to "myapps" and changed it in the whole project. 因此,我去过清单文件-双击“示例”,然后折射它,更改为“ myapps”,然后在整个项目中对其进行更改。 Now I try to upload it and I still get the same error message. 现在,我尝试上传它,但仍然收到相同的错误消息。 Anybody knows how to fix this error ? 有人知道如何解决此错误吗? Many thanks in advance 提前谢谢了

It seems simple. 看起来很简单。 There are many ways from which one is this: 一种方法有很多:

After you change the name manually in the AndroidManifest.xml , you click on the R.java class and then press F6. AndroidManifest.xml手动更改名称后,单击R.java类,然后按F6。

R.java resides in the app/build/generated/source/r/debug/(packagename) directory. R.java驻留在app/build/generated/source/r/debug/(packagename)目录中。 It contains resource IDs for the things you use in the android app. 它包含您在android应用中使用的事物的资源ID。 Check this question for more information. 检查问题以获取更多信息。

Also, Amir is right, try to use a more unique package name. 另外,Amir是正确的,请尝试使用更独特的软件包名称。 Example: com.(familyname) or your company domain. 例如:com。(姓氏)或您的公司域。

For further information, you can visit this question. 有关更多信息,您可以访问问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM