設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 460|回復: 0
打印 上一主題 下一主題

How to change your Project Name & Package Name

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2020-4-17 22:45:29 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
Change the Project Name
1)go to your project folder, rename it…
2)Delete the .idea folder and .iml file.
3)Open the settings.gradle file with a text editor, like VSCode, and change the rootProject.name to your new project name.
4)Just open your project with the Android Studio and Gradle will sync again.

Close Android Studio
Change project root directory name
Open Android Studio
Open the project (not from local history but by browsing to it)
Clean project
If your settings.gradle contains the below line, either delete it or update it to the new name.      rootProject.name = 'Your old project name'
  • A new *.iml file will then be created, the old one(s) can safely be deleted.
  • Change app_name in strings.xml (if exists), otherwise it will build the APK with the old name.

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.



Change the Package Name1)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.
2)Right-Click > Refactor > Rename
In the new window press Rename package
Change name and press Refactor
…and press Do Refactor at the bottom.
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-6-12 00:46 , Processed in 0.239415 second(s), 18 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表