Android studio как изменить название приложения

I want to change the name of my project and module. But if I try to rename them Android Studio notify me some errors... e.g. I want to change the name from "MyApplication" to "AndroidApp" as shown ...

For one, I’d strongly suggest updating to the latest Android Studio (0.3.7 as of now); there are tons of bug fixes.

You’re running into bug https://code.google.com/p/android/issues/detail?id=57692, which is that if you try to use the UI to rename modules or your project, it doesn’t update the build files. Sorry, it’s really broken right now. I’d suggest changing the directory names directly in the filesystem, and updating your settings.gradle file to reflect the changes. Your project on disk should look something like this (with many more files than what’s shown here):

projectFolder
|--settings.gradle
|--applicationModuleFolder
|  |--build.gradle
|  |--src

it uses projectFolder’s name as the project name and applicationModuleFolder as the name of the module that your Android App lives in (the upper and lower outlined boxes in your screenshot, respectively). I think the way your project is set up now, they both have the same name; you can rename both to the same new name if you like, or you can give them different names; it doesn’t matter.

Once they’re renamed, edit your settings.gradle file; it will look something like:

include ':applicationModuleFolder'

just change the name to your new name there as well. Once these changes are made, click the Sync Project with Gradle Files button in the toolbar (if you’re running a very old version of Android Studio, it may not have that button, so you can close the project and reopen it in that case) and it should pick up the changes.

For one, I’d strongly suggest updating to the latest Android Studio (0.3.7 as of now); there are tons of bug fixes.

You’re running into bug https://code.google.com/p/android/issues/detail?id=57692, which is that if you try to use the UI to rename modules or your project, it doesn’t update the build files. Sorry, it’s really broken right now. I’d suggest changing the directory names directly in the filesystem, and updating your settings.gradle file to reflect the changes. Your project on disk should look something like this (with many more files than what’s shown here):

projectFolder
|--settings.gradle
|--applicationModuleFolder
|  |--build.gradle
|  |--src

it uses projectFolder’s name as the project name and applicationModuleFolder as the name of the module that your Android App lives in (the upper and lower outlined boxes in your screenshot, respectively). I think the way your project is set up now, they both have the same name; you can rename both to the same new name if you like, or you can give them different names; it doesn’t matter.

Once they’re renamed, edit your settings.gradle file; it will look something like:

include ':applicationModuleFolder'

just change the name to your new name there as well. Once these changes are made, click the Sync Project with Gradle Files button in the toolbar (if you’re running a very old version of Android Studio, it may not have that button, so you can close the project and reopen it in that case) and it should pick up the changes.

For one, I’d strongly suggest updating to the latest Android Studio (0.3.7 as of now); there are tons of bug fixes.

You’re running into bug https://code.google.com/p/android/issues/detail?id=57692, which is that if you try to use the UI to rename modules or your project, it doesn’t update the build files. Sorry, it’s really broken right now. I’d suggest changing the directory names directly in the filesystem, and updating your settings.gradle file to reflect the changes. Your project on disk should look something like this (with many more files than what’s shown here):

projectFolder
|--settings.gradle
|--applicationModuleFolder
|  |--build.gradle
|  |--src

it uses projectFolder’s name as the project name and applicationModuleFolder as the name of the module that your Android App lives in (the upper and lower outlined boxes in your screenshot, respectively). I think the way your project is set up now, they both have the same name; you can rename both to the same new name if you like, or you can give them different names; it doesn’t matter.

Once they’re renamed, edit your settings.gradle file; it will look something like:

include ':applicationModuleFolder'

just change the name to your new name there as well. Once these changes are made, click the Sync Project with Gradle Files button in the toolbar (if you’re running a very old version of Android Studio, it may not have that button, so you can close the project and reopen it in that case) and it should pick up the changes.

Improve Article

Save Article

  • Read
  • Discuss
  • Improve Article

    Save Article

    When you have worked a lot on an Android project and then if you need to rename the project there are lots of configuration files, .xml files, and gradle files in Android Studio that you’re afraid to break things up. Sometimes we end up creating a new Android Studio project, with the correct name and then pass the source files from the old project to the new one. Here we are changing the project name only. While changing the name make sure that the project name is written without spaces. Now the point that comes here is how we can Change Project Name in Android Studio. So in this article, we are going to discuss five different methods to change the Project Name in Android Studio.

    Method 1

    Step 1: Click on the Setting Icon and Uncheck Compact Middle Packages

    Step 2: Click on your Project Name and Go to Refractor > Rename 

    Step 3: Click on Rename Packages

    Step 4: Change the package name and click on Refractor

    Step 5: Click on Do Refractor and then you will fill in finding that the project name is changed

    Method 2

    Open app/build.gradle and change this line:

    android {

      defaultConfig {

          applicationId “com.example.yournewprojectname”

        }

    }

    Method 3

    Update app/src/main/res/values/strings.xml:

    <string name=”app_name”>New Project Name</string>

    Doing this name of your app will be changed.

    Method 4

    Open settings.gradle and change this line:

    rootProject.name = “New Project Name”

    Method 5

    Open app/src/main/AndroidManifest.xml and change the following line:

    <manifest xmlns:android=”http://schemas.android.com/apk/res/android”

      package=”com.example.yournewprojectnamewithoutspaces”>

    Last updated on: March 24, 2021

    Today, I’m going to show you how to change your project name and package name in your project very easily!

    Let’s dive right into it!

    Change the name of your project by closing the Android Studio, go to your project folder, rename it…

    Delete the .idea folder and .iml file. (To show hidden folders, press Cmd + Shift + . (dot) ).

    Open the settings.gradle file with a text editor, like VSCode, and change the rootProject.name to your new project name.

    Done! Project name has been changed! Just open your project with the Android Studio and Gradle will sync again.

    Change the App Name

    Usually, when you change the project name, you wanna change the name of your app too.

    Go to the res folder > values > strings.xml and change the app_name to your new name.

    Done!

    Change the Package Name

    To rename your package name, all you have to do is go to your AndroidManifest.xml file, put your mouse cursor in front of the part of the package name you want to change.

    Right-Click > Refactor > Rename

    In the new window press Rename package

    Change name and press Refactor

    …and press Do Refactor at the bottom.

    Your package name is usually in format com.domain.appname, in this example, we changed the appname part, but you can do the same steps for the domain.

    Last, go to your module-level build.gradle file and change the package name in applicationId

    Done! Package name has changed!

    If you have any questionsplease feel free to leave a comment below

    Чтобы переименовать название проекта в Android Studio открываем проект и нажимаем на Show Options Menu (шестеренка) и снимаем галочку с Compact Middle Packages. Таким образом разбиваем названия через точку на отдельные каталоги. Например, com.domain.application разбивается на каталог com в котором каталог domain и далее каталог application. По сути получается наименование сайта, только наоборот.

    Show Options Menu

    Затем выбираем каталог для переименования и правой клавишей мыши открываем Refactor->Rename

    refactor

    Появится окно предупреждения, жмем Rename Package

    rename package

    Указываем новое название каталога

    rename

    Далее снизу жмем Do Refactor

    do refactor

    После того, как переименовали файлы, возможно где-то в файлах остались старые названия приложения, например, com.domain.application. В Android Studio нажимаем комбинаций клавиш для поиска ctrl+shift+F. Отобразятся файлы, например, BuildConfig.java, Activity.java, Build.Gradle и другие, в которых есть старые названия, заменяем их на новые.

    2162


    Sometimes, we make our app using the code from youtube tutorials and blogs and may forget to change the package name at the start. Yes, this happens, most of the time.

    We don’t want to display other website name or Youtube channel name to be as our package name, We want a package name that defines us. If you are searching for a tutorial about how to change or rename the Android app package name in Android Studio, then this post is for you.

    In this post, I am going to discuss 3 methods that I am using and still working.

    • Method I – How to rename Android app package name in Android Studio
    • Method II – How to change full package name of project by creating new package
    • Method III – How to rename android app package name in Android Studio using existing package

    In this example, we will change package name com.androidride.myapplication” to “com.xyz.yourapplication”.

    • Best Android App Development Book For Visual Learners & Beginners?

    • RecyclerView In Android Ultimate Tutorial

    STEP 1

    rename android app package name

    • Open Android Studio project, Select package name or Java, Click the gear icon.

    STEP 2

    rename android app package name

    • Deselect Hide Empty Middle Packages. This breaks your folder structure into parts.

    rename android app package name

    • The package is brocken down.

    STEP 3

    rename android app package name

    • Right Click on AndroidRide, Refactor -> Rename . You can also use Shift + F6.

    A warning will appear.

    STEP 4

    rename android app package name

    • Click on Rename package

    STEP 5

    rename android app package name

    • Clear AndroidRide and put new Name in it. Here “xyz”

      STEP 6

      rename android app package name

      • Click Do Refactor

      STEP 7

      rename android app package name

      • Repeat the same process.
      • Right click on myapplication,Refactor -> Rename and Rename package.

      STEP 8

      rename android app package name

      • Change myapplication to yourapplication

      STEP 9

      rename android app package name

      • Click on Do Refactor.

      STEP 10

      • After changing the package name, open build.gradle(module) and change Application Id

      STEP 11

      rename android app package name

      • change applicationid “com.androidride.myapplication” to “com.xyz.yourapplication”.
      • After changing applicationid, click on sync now.

      Congrats. Package name successfully changed.

      • Android Layout? What is that?
      • Why setContentView() in Android Had Been So Popular Till Now?
      • Do you want to make apk in less time? Use this method
      • 2 Strategies about how to run android app over WiFi in Android Studio (without Root)

      Method 2 – How to change full package name of project by creating new package

      In this method, We are going to change package name “com.androidride.myapplication” to “info.xyz.yourapplication”

      STEP 1

      android studio how to change package name

      • Right click on com.androidride.myapplication package and select Refactor->Move

      STEP 2

      android studio how to change package name

      • Choose Move package “com.androidride.myapplication” to another package and click on OK.

      STEP 3

      android studio how to change package name
      Now you will get a warning dialog shows Multiple directories correspond to package com.androidride.myapplication

      • Click on Yes

      STEP 4

      android studio how to change package name

      • Enter the new package name except the last level, For example. If you want to make package name as “info.xyz.yourapplication” then type “info.xyz” only, like above. Avoid the last part, here “yourapplication”.

        STEP 5

        android studio how to change package name

        • Click YES for creating new package.

        STEP 6

        android studio how to change package name

        • Click on Do Refactor. Now package name “com.androidride.myapplication” changes into “info.xyz.myapplication“.

        STEP 7

        android studio how to change package name

        Now we have to change the last package level name,

        • Right click on package name -> Refactor -> Rename

        STEP 8

        android studio how to change package name

        • Click on Rename package

        STEP 9

        android studio how to change package name

        • Rename “myapplication” in to “yourapplication”.

          STEP 10

          android studio how to change package name

          • Click on “Do Refactor”

          STEP 11

          android studio how to change package name

          • Use CTRL key and select each package related to old package name and delete. You can use DELETE key in keyboard or right click after selecting old packages and click on delete option from the menu.

          STEP 12

          android studio how to change package name

          • Open build.gradle file, change applicationId and Click on sync now.

          Package name successfully changed to “info.xyz.yourapplication“.

          Method III – How to rename android app package name in Android Studio using existing package

          This method is also same as the second method. Just like second, we change package name “com.androidride.myapplication” to “info.xyz.yourapplication“.

          STEP 1

          android studio change package name of project

          • Right click on Java and select New -> Package

            STEP 2

            change apk package name android studio

            • Next dialog box appears, choose …appsrcmainjava as Destination Directory.

            STEP 3

            how to change package name android studio

            • Enter your package name, here info.xyz.yourapplication

            STEP 4

            android studio how to change package name

            • Now move old package files into new package. Here move files from “com.androidride.myapplication” to “info.xyz.yourapplication“. Just use CTRL key to select all files and drag it to new package.

            how to change full package name in android studio

            • Files moved.

            STEP 5

            rename android app package name

            • Open AndroidManifest.xml and change package name into “info.xyz.yourapplication

            .

            STEP 6

            android studio change package name

            • Open build.gradle (Module: app) file, change applicationId also. Change it to “info.xyz.yourapplication” and Click on Sync now.Now you might get errors. It is due to the R file import. There are two scenarios, we can do.
              1. Remove R file import line from both files and check the error still exists. If not then you can delete old package files now

                It’s done. You have successfully changed the package name.

              2. Otherwise, If the error still exists, do the below steps.

                STEP 7

                change package name android studio

                • Select R file import line just like above and press CTRL + SHIFT + R . Replace with new package name. Click on replace all.

                STEP 8

                android studio change package name of project

                • Click on replace

                STEP 9

                change apk package name android studio

                • Delete old package and related files

                STEP 10

                how to change package name android studio

                • Build->Rebuild

                Yes, the package name is changed.

                Express your thoughts below and tell your friends about this post. Thank you.
                how to change package name in android studio

    Как можно изменить название приложения и иконку, имя пакета и тд? То которое я указывал при создании проекта?


    • Вопрос задан

      более трёх лет назад

    • 19171 просмотр

    файл AndroidManifest.xml

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        android:versionCode="1"
        android:versionName="first"
        package="название пакета" >
    
    <application
            android:icon="@drawable/путь к файлу иконки"
            android:label="@string/название приложения">
    </application>

    Пригласить эксперта


    • Показать ещё
      Загружается…

    09 февр. 2023, в 09:28

    12000 руб./за проект

    09 февр. 2023, в 09:28

    5000 руб./за проект

    09 февр. 2023, в 07:58

    3500 руб./за проект

    Минуточку внимания

    I’m trying to learn how to build a simple app in Android just to satisfy my curiosity. This will also be a very handy skill because I use Android phones often, and there are times that the apps I download from Google Play Store lack features that I need.

    This will be a very simple guide on how to change app name in Android Studio, something that most beginners in Android development probably want to know.

    It is assumed in this guide that you have prior knowledge in coding.

    The app name that I’m referring to is the one that says “My Application”, as marked on the image below:

    How to change app name in Android Studio

    To change that, go to your Project and find the app folder. Under app, find AndroidManifest.xml and edit android:label="My Application", replacing “My Application” with the name you’d like to use.

    Refer to the image below:

    android-studio-android-manifest

    Your changed app name should be reflected in the live preview now, if you have it activated. If you don’t have live preview yet, check this out: Where is Android Studio layout preview?

    Updates…

    How to rename project folders of Android Studio

    You may also want to change the name of your Android app’s folder. Check this folder, it’s probably where your Android project folder is located — C:UserscatkengAndroidStudioProjects

    How to rename package in Android Studio

    Right-click on your package name in the Project tree. It’s probably under app->java. Then choose “Refactor”, then choose “Rename”. Take note that you’ll see “Rename package” and “Rename folders” button here — you might need to go back to this screen later to click “Rename folders”. For now, click the “Rename package” button. Type the new name that you want to use, then click “Refactor”. If that hasn’t changed all package name instances for you, follow the same steps until you can click “Rename folders” button too. That should do it!

    Related Posts:

    Posts that may be related to «How to change app name in Android Studio»:

    A Filipino programmer with a variety of interests such as baking, singing, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert flavors, obsessing about finding out how some things works, board games, anime, video games, and forgetting things that usually go in her long list of interests. Running small-time online dessert shops Cookies PH and Catzie’s Cakery.

    Понравилась статья? Поделить с друзьями:

    Читайте также:

  • An unhandled error has occurred inside forge command failed git init git
  • An unhandled error has occurred in the application
  • An unexpected system error occurred перевод
  • An unexpected server error occurred перевод
  • Android studio как изменить значок приложения

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии