简体   繁体   English

Android专案R.java档案

[英]Android project R.java file

My question is if there is already a way to automate the creation of an app? 我的问题是是否已经有一种方法可以自动创建应用程序? For example a script that changes the package name in all necessary places? 例如,一个脚本是否在所有必要的地方更改了程序包名称? If that isn't possible I want to ask if there is a way to change the location of the generated R.java file? 如果不可能,我想问一下是否有一种方法可以更改生成的R.java文件的位置?

You can't change the location of R.java file. 您无法更改R.java文件的位置。

This is how you can rename your package name to all the places at one go. 这样您可以一次将包裹名称重命名为所有位置。

  1. Go to AndroidManifest.xml . 转到AndroidManifest.xml

  2. Put your cursor in the package name (don't select it). 将光标放在包名称中(不要选择它)。

  3. Press shift+F6 , you will get a popup window, select Rename package. shift+F6 ,您将弹出一个窗口,选择重命名包。

  4. Enter your new name and select Refactor. 输入新名称,然后选择“重构”。

Update: This is how you can rename the package name using an ant build, a ref to SO post 更新:这是您如何使用ant build(对SO post的引用)重命名包名称的方法

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

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