title: Find problems in Android XML
body: <p>I am facing the typical <code>cannot resolve symbol R</code> problem in Android Studio after moving some Class and XML files to a new <code>com.android.library</code> module from my main <code>com.android.application</code> module. </p>
  
  <p>I tried already to <code>Invalidate Caches/Restart</code> and <code>Cleaning/Rebuilding</code> my project several times. I also deleted the .iml files of my project and restarted Android Studio.</p>
  
  <p>Nothing has worked so far and I can't seem to find any specific pointer to the actual error. I think it should be an XML problem as it is often the case.</p>
  
  <p>Is there a way to check the XMLs for errors in a more systematic way than opeing all the files and copy editing them line by line? The <code>Messages Gradle Build</code> window is not showing any XML conflict.</p>
  
  <p>As an extra, one interesting thing is that Android Studio recognizes some of the references to XML resources, even in this broken state.</p>
  
  <p>In this case it is recognizing a resource linked from a different module referenced in Java even if the R class is not recognized nor imported:</p>
  
  <p><a href="https://i.stack.imgur.com/pPKri.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pPKri.png" alt="Java problem"></a></p>
  
  <p>In this case, it is recognizing a string resource on the same module in XML:</p>
  
  <p><a href="https://i.stack.imgur.com/I41PO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I41PO.png" alt="XML problem"></a></p>
  
  <p>Could it be an issue with Android Studio itself?</p>