Android project won't build when editing a resource file

后端 未结 8 1351
北恋
北恋 2020-12-13 17:45

I have an Android 1.5 project in Eclipse and whenever I merely have an xml resource file open the build dies with an error. E.g. if I have the res\\layout\\main.xml

相关标签:
8条回答
  • 2020-12-13 18:20

    Eclipce / Project / Clean ... And run your project again ...

    0 讨论(0)
  • 2020-12-13 18:21

    I had the same issue with same named nine-patch and normal images. Giving different names solves the issue.

    0 讨论(0)
  • 2020-12-13 18:23

    That will happen in the eclipse Indigo(IDE). when you are trying to run XML file instead of source pages(java files). So that will generate a file with the name of main.out.xml. so we have to delete the main.out.xml file and run the source files..

    i Hope this will work..

    0 讨论(0)
  • 2020-12-13 18:24

    To configure the run button to always run the previously launched application:

    Eclipse -> Window -> Preferences -> Run/Debug -> Launching -> Launch Operation -> Always Launch the previously launched application

    0 讨论(0)
  • 2020-12-13 18:29

    I just had the same problem because I had two files of different type format, but with the same name, like: jquerymobile.css and jquerymobile.js

    the solution was to rename one of the files

    0 讨论(0)
  • 2020-12-13 18:30

    I ran into this as well.

    If you have an xml file open and click the 'Run' button, then instead of running your Android project Eclipse will try to run a transform on the xml file. It then creates a new xml file with the output of the transform and adds it to your project. Then the project will fail to run at all because of the existence of the duplicate xml file.

    So make sure you don't have any duplicate xml files in your project (look at the manifest file, as well as layout files). The way I work around this is to make sure the project tree has focus (or just select a tab with a java file) before clicking 'Run'.

    There is likely a better way to handle this (via a config change perhaps), but I'm pretty new to Eclipse and that's the workaround I came up with :). Hope that helps.

    0 讨论(0)
提交回复
热议问题