6

I have already referred to this question Eclipse Problems View not showing Errors anymore But that does'nt seem to solve my problem

My current configuration

Windows 7 64-but Eclipse Java EE IDE For Web Developers (Tried a few versions Juno, Indigo)

Eclipse keeps throwing errors "R cannot be resolved to a variable" but does'nt show errors in xml files.

A quick example

<EditText
    android:id="@+id/srchUsers"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:layout_marginBottom="0dp"
    android:layout_marginTop="10dp"
    android:background="@android:color/white"
    android:ems="10"
    android:hint="Search Users"
    android:inputType="text"
    android:maxLines="1"
    android:paddingLeft="10dp"
    android:drawableLeft="@drawable/ic_action_search_black" 
    >

The drawable ic_action_search_black does'nt exist, but eclipse does not show any errors other than the dreaded "R cannot be resolved". I have tried most of the solutions like checking problems view, markers view, making sure all errors are set to be shown etc. But nothing worked.

I thought it could be eclipse 64 bit, but 32-bit versions of eclipse on Win 7 64-but gives me the same errors.

However, i have another old machine running Win 7 32-bit with the same eclipse (32 bit ofcourse); I can see errors in layout(xml) files and its pretty easy for me to debug.

I am losing valuable time in debugging with my current development machine.

Any help is highly appreciated.

Eclipse settings

Window -> Preferences ->Android -> Build -> Output is set to verbose

Problems Pane -> Configure Contents -> Show all items is checked

Markers Pane - > Configure Contents - > Show all items is checked

No error is shown

Notice the image shows R cannot be resolved, there are no xml errors shown, where as there is clearly an xml error.

Community
  • 1
  • 1
Veeru
  • 4,936
  • 2
  • 43
  • 61
  • This started right after you installed the plugin(meaning it didn't work from the beginning) or it stopped working after doing something else(like adding a library to the project, adding more files etc)? – user Oct 01 '12 at 08:47
  • I cant exactly remember the sequence of events, but i have not added any plugins other than ADT, no custom plugins what-so-ever. I have added ActionBarSherlock to my project, even in that project if there are xml errors(when i try to modify some layouts), it does'nt show up. Closing projects, cleaning them, restarting eclipse - nothing helps. – Veeru Oct 01 '12 at 09:12
  • 1
    I encountered the same problem when copying some code in an android project, but then I also got an error with the `appt` tool which crashed whenever trying to build something. In order to see what was happening I increased the verbosity level of the build in preferences-> android->build. I got an error code that lead me to this question http://stackoverflow.com/questions/10699439/aapt-filing-with-error-code-1073741819 . – user Oct 01 '12 at 10:04
  • Yes i do get the aapt errors too - What's frustrating is, it is hard to know what the error is and debugging becomes close to impossible. The thread you mentioned, does'nt have much info either. ALl i need is point me to the error so i can debug it and get on with work :( – Veeru Oct 01 '12 at 15:43
  • Did you increased the verbosity of the build like I said above(change it to verbose)? Then you should see the problem in Eclipse's Problems view. – user Oct 01 '12 at 15:47
  • Yes Luksprog, that's one of the things i have tried. Including settings of Markers and problems windows. – Veeru Oct 02 '12 at 00:48
  • I also encountered that kind of problem. I just test my app every time I changed the xml file. – AmyWuGo Oct 02 '12 at 01:27
  • What you're seeing in the XML source are **Warnings**, not **Errors** (the image is different). Double-click on one of the Errors in the Problems view and you should be sent to where it was actually marked. – nitind Jun 24 '13 at 03:39

1 Answers1

0

just use like this at second time:-

android:layout="@id/leftText"

Reason is there you use second time android:layout="@+id/leftText" is cause id conflict in R.java with previous one.

I hope this help you.

pRaNaY
  • 24,642
  • 24
  • 96
  • 146