title: android library project: R.id cannot be resolved or is not a field
body: <p>The library project looks fine, but as soon as I import it to my main project, it shows me errors on each line which is referencing a resource:</p>
  
  <blockquote>
    <p><em>id cannot be resolved or is not a field</em></p>
  </blockquote>
  
  <p>The main project shows no errors.</p>
  
  <p>Of cause I ask myself where android knows where to import the resources from e.g. in lines like that:</p>
  
  <pre><code>RelativeLayout menuLayout = (RelativeLayout) this.findViewById(R.id.menu_layout);
  </code></pre>
  
  <p>But this works neither:</p>
  
  <pre><code>RelativeLayout menuLayout = (RelativeLayout) this.findViewById(net.bla.library.R.id.menu_layout);
  </code></pre>
  
  <p>Any Ideas?</p>
  
  <p>EDIT: what I found out is:</p>
  
  <p>As soon as I include the library project, Eclipse duplicates the gen/net.mylibrary.R from the library into the main app (so there are 2 packages in the gen folder now: the one from the app, and the copied one from the library). strange thing is: R.id is not found in the copy. There are some other differences too, like the copy uses an additional "final" for its definitions.</p>
  
  <p>I really have no clue why this might happen. Someone?</p>