A summary of common problems and solutions for Android development

Source: Internet
Author: User
Tags xsl
A summary of common problems and solutions for Android development

1.activitymanager:warning:activity not started, it current Taskhas been brought to the front
Description: There is already an instance running in the emulator.
Workaround: Quit the program running in the simulator and run it again to resolve it.

2.Nogrammar constraints (DTD or XML Schema) detected for the document
Description: In the editor, see a warning like this about a missing syntax constraint (DTD or XML schema), despite ignoring these warnings.
Workaround: Windows->preferences-> XML-> XML files-> validation-> indicate when Nogrammar is specified: select IGN Ore can be.

3. R.java:no such file or directory
Description: R class does not exist.
Workaround: In Windows->preference->java->buildpath, change the folders to select projects.

4.res\layout\*.xml:invalid file name:must contain only [a-z0-9_.]
Description: The filename of the style XML does not meet the requirements. The file name can only be lowercase English characters, numbers, "_" or ".".

5.install_parse_failed_inconsistent_certificates
Description: This problem is mainly caused by signature conflicts, such as you use the ADB's debug permission signature, but later use the standard sign signature and then install the same file will appear this error message.
Workaround: Uninstall the original version and install it, and the adb install-r parameter is not able to solve the problem.

Why the 6.Android program did not exit the design.
A: Google Android platform in the design program declaration cycle is very special, may be due to the second load to ensure that the speed of the reasons for not forced to join the memory release problem, all the resource recovery by the Dalvik GC automatic completion, so in the design and development must pay attention to activity and Life cycle issues with service classes, the top-level windows will have the highest priority and automatically kill the process according to the historical stack priority when the Android operating system is out of memory.

The 7.EmulatorControl GPS Track send button sometimes turns gray.
Answer: Restart Eclipse.

8.android.content.activitynotfoundexception:unable to find explicit activity class {XXX}
A: In Androidmainifest.xml, declare xxxactivity, such as: <activity Android:name = ". Xxxactivity ">

9. The simulator cannot open, the item has the error (Your project contains error (s) ... )
A: There may be no errors in the project, but there will still be such a hint, refresh restart still can not solve the words, delete the item (do not choose to delete the file), to import again.

10.Eclipse error "No embedded stylesheetinstruction for file" solution

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\launch.xml
21:11:58,453 FATAL [main] main-no embedded stylesheet instruction for File:file:/e:/javawebapp/myapp/config.xml
Org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException:No embeddedstylesheet Instruction for file: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: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 project to find the main () method to run, but rather "runs" the current XML file, and I don't know what it is, and the result is simple, Because your XML does not conform to eclipse's "run" requirements, it naturally has an error.

Eclipseseems to want to "run" whatever you have selected. Go knows what it ' sdoing ' if you have a try to run something like Strings.xml, but it fails andgenerates a. out file ... which th En corrupts your Android project Becauseandroid doesn ' t understand all of the the. out files laying all of the place.

Workaround: Do not put the editing interface on XML when you run project, or manually select the class in which the main () method is located, and click Run.

RemoveAll of the *.out.* files in your project. When your run, click on
The project (top level) in the Package browser (left pane)
Ensure that your are doing "run as" an Android application.

11. An internal error occurredduring appears: "Launching New_configuration". Path for project must haveonly one segment. Hint error.

In eclipse, follow the steps below

Project-> Properties->run/debug Settings:
1. Select "Launching New_configuration"
2. Delete
3. OK

12. Enter Android list targets in DOS not internal or external commands

Find where to set the environment variable, and then add it in Path

; C:\Android\android-sdk\tools; C:\Android\android-sdk\platform-tools

13.Error parsing xml:unboundprefix.

< TextView
Android:layout_width= "Wrap_content"
Andriod: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 should to be "Android".

At the I-I-crazy because I could not find out Thereason. I should be more carefull!

14.AndroidFailed to install on device ' emulator-5554′: Solution to the problem of timeout

Eclipse-> window-> Preferences-> android-> DDMS-> ADB Connection Time Out (MS). Set this to a longer length, the default is 5 seconds, I changed to 20 seconds on OK, okay. Then reboot the simulator so that you don't have to reboot the simulator every time.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.