title: Unit testing: Entry name 'res/layout/test_toolbar.xml' collided
body: <p>I've tried to do some unit test example that included in an Android Studio project like <code>ExampleInstrumentedTest</code> and <code>ExampleUnitTest</code>, so the result is :</p>
  
  <blockquote>
    <p>Entry name 'res/layout/test_toolbar.xml' collided</p>
  </blockquote>
  
  <p>I've searched everywhere on google but there's not answers to this specific problem, so any help will be grateful </p>
  
  <p>here's the source of the basic unit test example :  </p>
  
  <p><strong>ExampleUnitTest</strong></p>
  
  <pre><code> * Example local unit test, which will execute on the development machine (host).
   *
   * @see &lt;a href="http://d.android.com/tools/testing"&gt;Testing documentation&lt;/a&gt;
   */
  public class ExampleUnitTest {
      @Test
      public void addition_isCorrect() {
          assertEquals(4, 2 + 2);
      }}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/PA2f0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PA2f0.png" alt="enter image description here"></a></p>
  
  <p><strong>ExampleInstrumentedTest</strong></p>
  
  <pre><code> * Instrumented test, which will execute on an Android device.
   *
   * @see &lt;a href="http://d.android.com/tools/testing"&gt;Testing documentation&lt;/a&gt;
   */
  @RunWith(AndroidJUnit4.class)
  public class ExampleInstrumentedTest {
      @Test
      public void useAppContext() {
          // Context of the app under test.
          Context appContext = InstrumentationRegistry.getInstrumentation().getContext();
  
          assertEquals("com.example.abder.emarque", appContext.getPackageName());
      }}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yZRqZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yZRqZ.png" alt="enter image description here"></a></p>