title: Upgrading Library Versions Causes Build Failure in project that depends the library
body: <p>We are maintaining an Android Library. Lately we upgraded gradle, compileSdkVersion and support library versions. (only using com.android.support:design). Also we upgraded gcm-play-services
  The library is published to Artifactory with its dependencies also in a pom file.
  This upgrade works perfectly on projects with upto-date build tools and support libraries. However we are facing an issue with outdated projects that uses our library.
  Here is the versions of library.</p>
  
  <pre><code>gradle android plugin -&gt; 3.2.1
  compileSdkVersion -&gt; 28
  targetSdkVersion -&gt; 28
  support library version -&gt; 28.0.0
  </code></pre>
  
  <p>Here is the versions of project</p>
  
  <pre><code>compileSdkVersion -&gt; 26
  targetSdkVersion 26
  support library version -&gt; 26.0.1
  </code></pre>
  
  <p>and client support library dependencies </p>
  
  <pre><code>implementation 'com.android.support:cardview-v7:' + androidSupportV
  implementation 'com.android.support:recyclerview-v7:' + androidSupportV
  implementation 'com.android.support:appcompat-v7:' + androidSupportV
  implementation 'com.android.support:design:' + androidSupportV
  implementation 'com.android.support:support-v4:' + androidSupportV
  implementation 'com.android.support:support-annotations:28.0.0'
  </code></pre>
  
  <p>after trying to build the project with new library, build fails with this log.</p>
  
  <pre><code>AGPBI: {"kind":"error","text":"error: resource android:attr/dialogCornerRadius not found.","sources":[{"file":"/Users/umutyusuf/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/d4439e502685c256006fa4bec8edb713/res/values-v28/values-v28.xml","position":{"startLine":8,"startColumn":4,"startOffset":447,"endLine":11,"endColumn":12,"endOffset":684}}],"original":"","tool":"AAPT"}
  AGPBI: {"kind":"error","text":"error: resource android:attr/dialogCornerRadius not found.","sources":[{"file":"/Users/umutyusuf/Documents/repo/core-bootstrap/core-android-client-app/PointrSample-Ozion-v5.0.8/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml","position":{"startLine":10}}],"original":"","tool":"AAPT"}
  AGPBI: {"kind":"error","text":"error: resource android:attr/fontVariationSettings not found.","sources":[{"file":"/Users/umutyusuf/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/d4439e502685c256006fa4bec8edb713/res/values/values.xml","position":{"startLine":1303,"startColumn":4,"startOffset":70911,"endColumn":68,"endOffset":70975}}],"original":"","tool":"AAPT"}
  AGPBI: {"kind":"error","text":"error: resource android:attr/ttcIndex not found.","sources":[{"file":"/Users/umutyusuf/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/d4439e502685c256006fa4bec8edb713/res/values/values.xml","position":{"startLine":1303,"startColumn":4,"startOffset":70911,"endColumn":68,"endOffset":70975}}],"original":"","tool":"AAPT"}
  </code></pre>
  
  <p>We avoid to do any manipulations in project code, so tried to solve it in library.</p>
  
  <p>We downgrade the all versions to match the project versions. And published it with again with</p>
  
  <pre><code>compileSdkVersion -&gt; 26
  targetSdkVersion 26
  support library version -&gt; 26.0.1
  </code></pre>
  
  <p>But after that, we face a manifest merge error</p>
  
  <pre><code>Error:
      Attribute meta-data#android.support.VERSION@value value=(26.0.1) from [com.android.support:cardview-v7:26.0.1] AndroidManifest.xml:25:13-35
      is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
      Suggestion: add 'tools:replace="android:value"' to &lt;meta-data&gt; element at AndroidManifest.xml:23:9-25:38 to override
  </code></pre>
  
  <p>This is originated from gcm-play-services which has support-v4:26.1.0 transitive dependency listed in dependency tree. </p>
  
  <p>and to resolve it, added this to manifest</p>
  
  <pre><code>&lt;meta-data
              tools:node="replace"
              tools:replace="android:value"
              android:name="android.support.VERSION"
              android:value="26.0.1" /&gt;
  </code></pre>
  
  <p>This made it all work. <em>But now what would be the drawbacks of putting this meta tag to AndroidManifest file?</em></p>
  
  <p>We tested this approach with all of compileSdkVersion 26, 27, 28 
  and all corresponding support library version. All seem to work.</p>
  
  <p>We are search for better approaches to this.</p>
  
  <p>Alternative solution we tried</p>
  
  <p>We published the support library dependency in provided scope. But in this case projects using library should add their support design library to be able to use the with no problem. <em>But even though they add the support library, would it be a problem if project had different support library version other then what library is compiled with?</em></p>