如何在Android Studio中重命名“ AndroidTest”包

时间:2019-07-16 21:40:03

标签: android-studio android-layout

enter image description here我已经准备好了资源,并且想重命名AndroidTest文件夹,就像重命名其他文件夹一样,但是每次单击“重构”和“重命名”都不会发生

1 个答案:

答案 0 :(得分:0)

请按照以下步骤进行操作:

  • 在“项目”窗格中,单击右侧的小设置图标,然后取消选中/取消选择Compact Empty Middle Packages option,如下所示:

enter image description here

  • 选择从包创建的各个目录,然后右键单击refactor,然后重命名。像这样在需要时选择Rename All

enter image description here

  • 打开应用级别的build.gradle,并用您的新软件包名称更改applicationId中的defaultConfig字段,并像我在{{ 1}}文件:

enter image description here

希望这会有所帮助!

相关问题