title: How to use tools:overrideLibrary with multiple libraries
body: <p>I would like to create an Android project that is compatible to e.g. API level 4 but would still like to test it with UiAutomator that requires API level 18 on newer devices. So the app would also run on old devices but the automatic tests would be performed on new devices.</p>
  
  <p>Therefore I have created a new project with Android Studio and added the UiAutomator test libraries:</p>
  
  <pre><code>dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    androidTestCompile 'com.android.support:support-annotations:23.0.1'
    androidTestCompile 'com.android.support.test:runner:0.3'
    androidTestCompile 'com.android.support.test:rules:0.3'
    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
  }
  </code></pre>
  
  <p>When compiling it I get the error</p>
  
  <pre><code>Error:Execution failed for task ':app:processDebugAndroidTestManifest'.
  &gt; java.lang.RuntimeException: Manifest merger failed : uses-sdk:minSdkVersion 4 cannot be smaller than version 8 declared in library [com.android.support.test:runner:0.3] /Users/dom/Entwicklung/MacBookPro/git/GradleTest/app/build/intermediates/exploded-aar/com.android.support.test/runner/0.3/AndroidManifest.xml
      Suggestion: use tools:overrideLibrary="android.support.test" to force usage
  </code></pre>
  
  <p>Adding</p>
  
  <pre><code>&lt;uses-sdk tools:overrideLibrary="android.support.test"/&gt;
  </code></pre>
  
  <p>to the AndroidManifest.xml causes another error to occur:</p>
  
  <pre><code>Error:Execution failed for task ':app:processDebugManifest'.
  &gt; Manifest merger failed : uses-sdk:minSdkVersion 4 cannot be smaller than version 7 declared in library [com.android.support:appcompat-v7:23.0.1] /Users/dom/Entwicklung/MacBookPro/git/GradleTest/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/AndroidManifest.xml
      Suggestion: use tools:overrideLibrary="android.support.v7.appcompat" to force usage
  </code></pre>
  
  <p>Changing it to</p>
  
  <pre><code>&lt;uses-sdk tools:overrideLibrary="android.support.test, android.support.v7.appcompat"/&gt;
  </code></pre>
  
  <p>causes the first error again:</p>
  
  <pre><code>Error:Execution failed for task ':app:processDebugAndroidTestManifest'.
  &gt; java.lang.RuntimeException: Manifest merger failed : uses-sdk:minSdkVersion 4 cannot be smaller than version 8 declared in library [com.android.support.test:runner:0.3] /Users/dom/Entwicklung/MacBookPro/git/GradleTest/app/build/intermediates/exploded-aar/com.android.support.test/runner/0.3/AndroidManifest.xml
      Suggestion: use tools:overrideLibrary="android.support.test" to force usage
  </code></pre>
  
  <p>I am using the latest Android Studio and build tools. The gradle command that Android Studio uses to build the app is</p>
  
  <pre><code>Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources]
  </code></pre>
  
  <p>so the problem can be reproduced e.g. with</p>
  
  <pre><code>gradle :app:generateDebugAndroidTestSources :app:compileDebugAndroidTestSources
  </code></pre>
  
  <p>What is the correct syntax to specify multiple libraries in tools:overrideLibrary ? I have read that a comma and a space would be correct, but it doesn't seem to work. I have read a lot about it here on StackOverflow and elsewhere but unfortunately I couldn't find a solution so far (aside from commenting out the tests).</p>