google-services.json file for each flavor in android studio
<p>I have different productFlavors specified in my build.gradle file</p>

<pre><code>dev {
        applicationId ""
        versionCode 83
        versionName "2.2.1"
    }
staging {
        applicationId ""
        versionCode 119
        versionName "2.8.1"
    }
</code></pre>

<p>both flavors have different project ids etc for google services. i have placed respective google-services.json file in assests folder in each flavor like this</p>

<blockquote>
  <p>src>dev>assests>google-services.json</p>
</blockquote>

<p>and</p>

<blockquote>
  <p>src>staging>assests>google-services.json</p>
</blockquote>

<p>google-services json must be present on root level on compilation. </p>

<p>what should i have to specify in my build.gradle file so that respective file or content should be copied to root folder's file when i build a particular flavor.</p>

<p><a href="https://i.stack.imgur.com/eJagx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/eJagx.png" alt="enter image description here"></a></p>