Rename package in Android Studio

后端 未结 30 1907
深忆病人
深忆病人 2020-11-21 05:21

How do you rename packages in the new IDE Android Studio, based on IntelliJ IDEA?

Is there an automatic refactoring included?

I want to make bulk refactorin

30条回答
  •  一生所求
    2020-11-21 05:59

    1. Open the file:

      app → manifests → AndroidManifest.xml

      Highlight each part in the package name that you want to modify (don't highlight entire package name) then:

      • Mouse right click → Refactor → Rename → Rename package
      • type the new name and press (Refactor)

      Do these steps in each part of the package name.

    2. Open (Gradle Script) >> (build.gradle(Modul:app))

      and update the applicationId to your package name

    3. Open the menu (build) and choose (Rebuild Project).

提交回复
热议问题