title: Getting error while creating build variant source set in android studio
body: <p>I'm new to Android Studio build variant. I created a new app, edited the build flavors in gradle and successfully synced it. But when I add source set for one of the build variant(demoDebug) it shows error. </p>
  
  <p><strong>Module level build.gradle file:</strong></p>
  
  <pre><code>    apply plugin: 'com.android.application'
  
      android {
          compileSdkVersion 28
          defaultConfig {
              applicationId "com.example.shaon.myappbuildtest"
              minSdkVersion 15
              targetSdkVersion 28
              versionCode 1
              versionName "1.0"
              testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
          }
          buildTypes {
              release {
                  minifyEnabled false
                  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
              }
  
              debug {
                  applicationIdSuffix ".debug"
                  debuggable true
              }
          }
  
          flavorDimensions "version"
          productFlavors {
              demo {
                  dimension "version"
                  applicationIdSuffix ".demo"
                  versionNameSuffix "-demo"
              }
              full {
                  dimension "version"
                  applicationIdSuffix ".full"
                  versionNameSuffix "-full"
              }
          }
          sourceSets { debug { java.srcDirs = ['src/debug/java', 'src/debug/java/'] } }
      }
  
      dependencies {
          implementation fileTree(dir: 'libs', include: ['*.jar'])
          implementation 'com.android.support:appcompat-v7:28.0.0'
          implementation 'com.android.support.constraint:constraint-layout:1.1.3'
          testImplementation 'junit:junit:4.12'
          androidTestImplementation 'com.android.support.test:runner:1.0.2'
          androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
      }
  </code></pre>
  
  <p><strong>Project Structure Screen Shot:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/72RvN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/72RvN.jpg" alt="project structure"></a></p>
  
  <p><strong>Manifest.xml for main</strong></p>
  
  <pre><code>            &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.shaon.myappbuildtest"&gt;
  
          &lt;application
              android:allowBackup="true"
              android:icon="@mipmap/ic_launcher"
              android:label="@string/app_name"
              android:roundIcon="@mipmap/ic_launcher_round"
              android:supportsRtl="true"
              android:theme="@style/AppTheme"&gt;
              &lt;activity android:name=".MainActivity"&gt;
                  &lt;intent-filter&gt;
                      &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                      &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
                  &lt;/intent-filter&gt;
              &lt;/activity&gt;
          &lt;/application&gt;
  
      &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>Manifest.xml for demoDebug</strong></p>
  
  <pre><code>    &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.shaon.myappbuildtest.demo.debug"&gt;
  
          &lt;application&gt;
              &lt;activity android:name="com.example.shaon.myappbuildtest.demo.debug.MainActivityDemoDebug"&gt;&lt;/activity&gt;
          &lt;/application&gt;
      &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>Error that I am getting when creating the folder for source set for demoDebug:</strong></p>
  
  <pre><code>Manifest merger failed : Overlay manifest:package attribute declared at AndroidManifest.xml:2:5-58 value=(com.example.shaon.myappbuildtest.demo.debug)
  has a different value=(com.example.shaon.myappbuildtest.demo.debug) declared in main manifest at AndroidManifest.xml:3:5-47
  Suggestion: remove the overlay declaration at AndroidManifest.xml   and place it in the build.gradle:
      flavorName {
          applicationId = "com.example.shaon.myappbuildtest.demo.debug"
      }
  </code></pre>
  
  <p>What did I do wrong? How do I fix it?</p>