title: Build app with api 26 but libs with api 24
body: <ul>
  <li>I migrated to android studio 3.1</li>
  <li>I use an external dependency which uses API 24. I can not do code changes here.</li>
  <li>I need to build my app with API 26.</li>
  </ul>
  
  <p>is it possible? how can this be done?</p>
  
  <p>During various trials, I got this error</p>
  
  <blockquote>
    <p>Gradle: Error: more than one library with the package name
    'recyclerview'</p>
  </blockquote>
  
  <p>app build.gradle</p>
  
  <pre><code>dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support:recyclerview-v7:26.1.0'
      implementation 'com.google.android.gms:play-services-gcm:15.0.1'
      implementation 'com.google.android.gms:play-services-location:15.0.1'
      implementation 'com.google.android.gms:play-services-places:15.0.1'
      implementation project(path: ':libs:externalLib', configuration: 'default')
  </code></pre>
  
  <p>libs:externalLib build.gradle</p>
  
  <pre><code>dependencies {
      compile 'com.android.support:recyclerview-v7:24.0.0-alpha2'
      compile 'com.android.support:support-v4:24.0.0-alpha2'
  }
  </code></pre>
  
  <p>Or can I target for API 26 while using 24.x everywhere as a workaround?</p>