Android changes the application package name (the number of package name levels before and after the change is different)

androidStudio changes project package name

Hello everyone, my project recently had a problem and was removed from the shelves. For emergency response, I restarted the previous project. However, the package names are inconsistent, and the package name levels are not the same. I checked many methods on the Internet, but they did not apply to me. The package name level is inconsistent. Well, let’s take a look at the example of my new project. My project’s initial package name is: com.example.testcgpackage and then I want to change it to com.test.android.testcgpackage. This is more. One-level package name

Insert image description here
First, check whether the hierarchy button is turned off in your project directory as shown below:
Insert image description here
Make sure the option is turned off
Then continue the operation, right-click the package name file com and select New Package Name Test. A
Insert image description here
pop-up box will appear. Add the package name test and press the Enter key on the keyboard:
Insert image description here
Then Left-click the test level, continue the above operation, right-click to create a new package name android, the result is as shown below:
Insert image description here
Go to the next step, click the testcgpackage package name file to move to the android package name layer, and
Insert image description here
Insert image description here
Insert image description here
Insert image description here
finally check whether the package names in the two files follow together Modification:
Insert image description here
Insert image description here
Remember to click the Sync now button in the upper right corner;

Okay, the package name change is completed. Remember, this is for package name modifications with different levels. If the package name levels are the same, you just need to modify a certain package name. You can find many methods by searching online. Thank you for watching. If you still have For other better methods, please leave a message.

Guess you like

Origin blog.csdn.net/mawlAndroid/article/details/131550683