need help changing my package name in eclipse

前端 未结 7 556
梦如初夏
梦如初夏 2020-12-17 14:05

so my package name is com.soundboard right now.

obviously this name is taken...I am having trouble changing it throughout the package name.

I checked a few p

7条回答
  •  我在风中等你
    2020-12-17 14:56

    Here are the steps I followed to rename my package structure in my android app.

    1. Sort your package explorer to use hierarchical structure
      • In package explorer perspective click the down arrow. Select Package Presentation > Hierarchical
    2. Rename your package.
      • Right click on the level at which you want all below packages to be renamed
      • Select Refactor > Rename...
      • Enter the new package name. Make sure all the check boxes are checked especially "Rename sub packages"
      • Follow the rest of the wizard to change your classes packages
    3. Review your manifest file to see if it has been messed up as part of the rename. Especially check the package attribute of your application.
      • Compare with your HEAD revision from your source control repo by Right click > Compare With > HEAD Revision
    4. Clean your project
      • Project > Clean..
      • Check your project
      • Click OK
    5. Debug your project and accept the new package name
      • Right click on project > Debug As > Android Application
      • In Dialog box that says "The package definition has changed...." click Yes
      • Your references to the R class in your *.java files may be wrong now. You will need to fix these.

提交回复
热议问题