1

When I start a new project in Android Studio, I always have to change the default domain name in the package name (the default is com.example).

Is there a way to change the default domain name to my domain so that I don't have to do this every time I start a new project?

Pfredd
  • 417
  • 6
  • 15

1 Answers1

1

The package specified in the New Project dialog in the Package name parameter will be saved after the project is created in the SAVED_ANDROID_PACKAGE parameter in the file ~/.config/Google/AndroidStudio2021.3/options/other.xml. The path is different on different OS and different IDE versions. Read for Find your configuration files

enter image description here

You can try the following ways:

  1. The classic way to solve all problems: Invalidate cache and restart
  2. Close IDE. Manually change SAVED_ANDROID_PACKAGE. Run IDE
  3. Check permissions to the configuration folder
  4. Close IDE. Delete (make a backup!!!) configuration folder. IDE will start as freshly installed and create a new configuration
Nick
  • 3,691
  • 18
  • 36
  • Say I create a project with one package name (say `com.codeguru`) that gets saved to `SAVED_ANDROID_PACKAGE`, then create a new project with a different base name (say `com.codeapprentice`). Will the second one overwrite the first in `SAVED_ANDROID_PACKAGE`? – Code-Apprentice Nov 24 '22 at 20:39
  • 1
    On the third creation, the package from the second case (`com.codeapprentice`) will be displayed by default – Nick Nov 25 '22 at 08:31