title: android, gradle, how to force to use a old com.google.firebase:firebase-messaging: dependence version
body: <p>Having dependency in the app</p>
  <pre><code>api 'com.google.firebase:firebase-messaging:20.0.1'
  </code></pre>
  <p>But the app has dependency on other sdk, which depends on new version</p>
  <pre><code>api 'com.google.firebase:firebase-messaging:21.1.0'
  </code></pre>
  <p>and the app is not ready for <code>21.1.0</code> (got <code>task.exception</code> = <code>java.io.IOException: FIS_AUTH_ERROR</code> on</p>
  <pre><code>FirebaseInstanceId.getInstance().instanceId
                      .addOnCompleteListener(OnCompleteListener { task -&gt; ...task.exception }
  </code></pre>
  <p>So would like to force to use <code>20.0.1</code>.</p>
  <p>and tried</p>
  <pre><code>configurations.all {
      resolutionStrategy {
          force 'com.google.firebase:firebase-messaging:20.0.1'
      }
  }
  </code></pre>
  <p>it does not work, and tried (hope the group==<code>com.google.firebase</code> and name ==<code>firebase-messaging</code> are used correctly):</p>
  <pre><code>configurations.all {
      resolutionStrategy.eachDependency { DependencyResolveDetails details -&gt;
          def requested = details.requested
          if (requested.group == 'com.google.firebase' &amp;&amp; requested.name == 'firebase-messaging') {
              details.useVersion '20.0.1'
          }
      }
  }
  </code></pre>
  <p>still it resolved to the newer <code>21.1.0</code>:</p>
  <p><a href="https://i.stack.imgur.com/f0lYl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f0lYl.png" alt="enter image description here" /></a></p>
  <p>and also see in the top level it has {strictly}, not sure where it is from:
  <a href="https://i.stack.imgur.com/b8gTx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b8gTx.png" alt="enter image description here" /></a></p>