Package name is an identifier assigned to each application in the Android system. Each Application ID must be different. During application development, you may need to modify the package name. Here, we will summarize the methods for modifying the package name and common problems and effective solutions.
In AndroidManifest. the package field in xml clearly specifies the package name, but it is not enough to modify the package name of the application by modifying the package field, because the package name is directly related to the resource file R, in every acitaskfile, there is such a sentence: import (package name ). r; therefore, to modify the package name, you also need to modify the package name in all files. Android ADT provides a unified replacement tool, as shown in:
If a java class file exists in the project when using the rename application package, the unexpected exception occured error message will appear, this problem can be solved by deleting the file or canceling the corresponding comment.
But how to find this fully commented out class is not mentioned, especially when the project is relatively large, it is more helpful to effectively find the fully commented out class. At first, I tried to identify the file that caused the error by looking at the specific error log prompt. However, I found that there was no file information in the error log of eclipse. Later, we found that we can check whether the import (package name). R statement has been commented out. In this case, search-> file search finds all the files containing the package name by searching the package name, expands the query results, and checks whether the import (package name) exists ). R is commented out.