Android Studio BuildVariants
<p>Here is my problem. I have an app which is working fine. I want the same app to have two different package name and drawable folders. So here is what i did,</p>

<pre><code>productFlavors {
    AppOne {
        applicationId 'com.AppOne'//Package name for AppOne
    }
    AppTwo{
        applicationId 'com.AppTwo'//Package name for AppTwo
    }
}
</code></pre>

<p>Then i created two different folder inside my src. The project structure looks something like this,</p>

<pre><code>src
   -&gt; AppOne
          -&gt;drawable
                    -&gt;Image for AppOne
   -&gt; AppTwo
          -&gt;drawable
                    -&gt;Image for AppTwo
   -&gt; UnchangedApp
          -&gt;drawable
                    -&gt;Image for someImage
</code></pre>

<p>As far as i understand when i take the build from Flavor AppTwo the "Image for AppTwo" will be used(If i am not wrong).
This also worked fine with seperate package names and seperate icons.
The problem is that i have a local html file inside my raw folder. And i refer this in code like this </p>

<pre><code>Webview.loadUrl("file:///android_res/raw/mytemplate.html");
</code></pre>

<p>The html file will also change for both the apps.So i created the raw folder for both the flavors. Now the project structure is like this</p>

<pre><code>src
   -&gt; AppOne
          -&gt;drawable
                    -&gt;Image for AppOne
          -&gt;raw
                    -&gt;mytemplate.html
   -&gt; AppTwo
          -&gt;drawable
                    -&gt;Image for AppTwo
          -&gt;raw
                    -&gt;mytemplate.html
   -&gt; UnchangedApp
          -&gt;drawable
                    -&gt;Image for someImage
          -&gt;raw
                    -&gt;sometemplate.html
</code></pre>

<p>Now when i run my app with flavor 1 or flavor 2, i am getting an error on webview like could not find file:///android_res/raw/mytemplate.html.</p>

<p>What mistake am i doing. The icons in the drawable folder are changing but the html file in raw is not. Can anyone help. Any help  would be appreciated.</p>

<p>Thanks</p>