FAQs about Android development and Solutions
1. activitymanager: Warning: activity not started, its current taskhas been brought to the front
Note: An instance is running in the simulator.
Solution: exit the program running in the simulator and run it again!
2. nogrammar constraints (DTD or XML Schema) detected for the document
Note: In the editor, you can see the following information about the lack of syntax constraints (DTD
Or XML
Architecture) Warning, despite ignoring these warnings.
Solution: Windows> preferences> XML files> Validation> indicate when nogrammar is specified:
Select ignore.
3. R. Java: no such file or directory
Note: The R class does not exist.
Solution: in Windows-> preference-> JAVA-> buildpath, change folders to select projects.
4. Res \ Layout \ *. xml: invalid file name: must contain only [a-z0-9 _.]
Note: The style XML file name does not meet the requirements. The file name can only contain lowercase English characters, numbers, "_", or ".".
5. install_parse_failed_inconsistent_certificates
Note: This problem is mainly caused by signature conflicts. For example, if you use the debug permission signature of ADB, however, the following error message is displayed when you use the standard sign to sign the file and then install the same file.
Solution: uninstall the original version and install it again. The ADB install-R parameter cannot solve this problem.
6. Why didn't the android program exit the design?
A: The Google Android platform has a special claim period for the design program. It may be due to the failure to force the memory to release due to the speed guarantee during the second loading. All the resources are recycled by Dalvik.
GC is automatically completed. Therefore, you must pay attention to the lifecycle of the activity and service classes during design and development. The window displayed at the top of the hierarchy has the highest priority, when the memory of the Android operating system is insufficient, the process is automatically killed by priority based on the historical stack.
7. the send button of the GPS track of emulatorcontrol is sometimes grayed out.
A: restart eclipse.
8. Android. content. activitynotfoundexception: unable to find explicit activity class {XXX}
A: declare xxxactivity in androidmainifest. XML, for example: <Activity
Android: Name = ". xxxactivity">
9. If the simulator cannot be opened, the system prompts a project error (your project contains error (s )...)
A: There may be no errors in the project, but this kind of prompt will still appear. If the problem persists after refresh and restart, delete the project (you do not have to delete the file) and re-import it.
10. Solution to the error "no embedded stylesheetinstruction for file" reported by ECLIPSE
21:11:57, 015 info [main] Main-javax. xml. Transform. transformerfactory = NULL
21:11:57, 015 info [main] Main-java. endorsed. dirs = D: \ ProgramFiles \ Java \ jre6 \ Lib \ endorsed
21:11:57, 031 info [main] Main-launchfile: e: \ javawebapp \. Metadata \. plugins \ org. Eclipse. WST. XSL. JAXP. Launching \ launch. xml
21:11:58, 453 fatal [main] Main-No embedded stylesheet instruction for file:/E:/javawebapp/MyApp/config. xml
Org. Eclipse. WST. XSL. JAXP. Debug. invoker. transformationexception: No embeddedstylesheet instruction for file:/E:/javawebapp/MyApp/config. xml
At org. Eclipse. WST. XSL. JAXP. Debug. invoker. Internal. jaxpsaxprocessorinvoker. Transform (jaxpsaxprocessorinvoker. Java: 225)
Atorg. Eclipse. WST. XSL. JAXP. Debug. invoker. Internal. jaxpsaxprocessorinvoker. Transform (jaxpsaxprocessorinvoker. Java: 186)
At Org. eclipse. WST. XSL. JAXP. debug. invoker. internal. main. main (main. java: 73) causedby: Org. eclipse. WST. XSL. JAXP. debug. invoker. transformationexception: No embeddedstylesheet instruction for file:/E:/javawebapp/MyApp/config. XML
At org. Eclipse. WST. XSL. JAXP. Debug. invoker. Internal. jaxpsaxprocessorinvoker. Transform (jaxpsaxprocessorinvoker. Java: 214)
... 2 more
Analysis: Because the editing interface displays an XML file, eclipse does not go to the project to find the main () method to run it when you click the run button, but "run" the current XML file, so I am not clear about what to do, and the result is very simple, because your XML does not meet the Eclipse "run" requirements, therefore, it naturally reports an error.
Eclipseseems to want to "run" whatever you have selected. go knows what it 'sdoing when you try to run something like strings. XML, but it fails andgenerates. out file... which then upload upts your android project becauseandroid
Doesn' t understand all the. out files laying all of the place.
Solution: do not place the editing interface in XML when running the project, or manually select the class of the main () method, and click "run ".
Removeall of the *. Out. * files in your project. When you run, click on
The project (top level) in the package browser (left pane) first, and
Ensure that you are doing "Run as" an Android Application.
11. An internal error occurredduring: "Launching new_configuration". Path for project must haveonly one segment is displayed. An error is prompted.
Perform the following operations in Eclipse:
Project-> properties-> Run/debug settings:
1. Select "Launching new_configuration"
2. Delete
3. OK
12. In DoS
Enter Android list targets
AndroidNot an internal or external command
Find the place where the environment variable is set and add it to the path
; C: \ Android-SDK \ tools; C: \ Android-SDK \ platform-Tools
13. Error parsing XML: unboundprefix.
<Textview
Android: layout_width = "wrap_content"
AndroidIoD: layout_height = "wrap_content"
Android: text = "@ string/main_title"
Android: layout_gravity = "center"
Android: layout_marginbottom = "25dip"
Android: textsize = "24.5sp"
/>
The reason is the word "andriod" in the 3rd lineis wrong, it shoshould be "android ".
At first I was crazy because I cocould not find out thereason. I shocould be more carefull!
14. androidfailed to install on device 'emulator-100': timeout
Solution
Eclipse-> window-> preferences-> Android-> ddms-> ADB connection time out (MS ). set the time to a longer value. The default value is 5 seconds. If it is changed to 20 seconds, it will be OK. Restart the simulator so that you do not need to restart the simulator every time ~