title: Android Content Provider and Gradle productFlavours
body: <p>I have app which should have 2 flavours: free and paid. Separately both versions works perfectly. But when I want to install 2 of them at once I'm getting error: [INSTALL_FAILED_CONFLICTING_PROVIDER]. I've tried to change android:authorities and buildConfigField values to be totally different but It's doesn't change anything - app won't install. Also I've deleted provider declaration in main Android Manifest - nothing. Please help me.</p>
  
  <p>My folders structure:</p>
  
  <pre><code>src
  |- free
  |   |- AndroidManifest.xml
  |- main
  |   |- all files and res catalogues (java, res, values etc.)
  |   |- AndroidManifest.xml
  |- premium
      |- AndroidManifest.cml
  </code></pre>
  
  <p>My gradle file:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  
  android {
  
  compileSdkVersion 19
  buildToolsVersion '20.0.0'
  
  final PROVIDER_FREE = "com.example.free.contentprovider"
  final PROVIDER_PRO = "com.example.pro.contentprovider"
  
  defaultConfig {
      minSdkVersion 14
      targetSdkVersion 20
  }
  buildTypes {
      release {
          minifyEnabled false // new version
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
  productFlavors {
      free {
          applicationId "com.example.free"
          versionCode 141201004
          versionName "1.004"
          buildConfigField "String", "PROVIDER_AUTHORITY", "\"" + PROVIDER_FREE + "\""
      }
      premium {
          applicationId "com.example.pro"
          versionCode 141210001
          versionName "0.001 Pro"
          buildConfigField "String", "PROVIDER_AUTHORITY", "\"" + PROVIDER_PRO + "\""
      }
  }
  }
  </code></pre>
  
  <p>My content provider:</p>
  
  <pre><code>public class DatabaseContentProvider extends ContentProvider {
      public static final String AUTHORITY = BuildConfig.PROVIDER_AUTHORITY;
      ...
  }
  </code></pre>
  
  <p>My free Android Manifest:</p>
  
  <pre><code>&lt;provider
          android:name="com.example.tools.DatabaseContentProvider"
          android:authorities="com.example.free.contentprovider"
          android:exported="false"
          android:grantUriPermissions="true"&gt;
       &lt;grant-uri-permission android:pathPattern=".*" /&gt;
  &lt;/provider&gt;
  </code></pre>
  
  <p>My premium Android Manifest:</p>
  
  <pre><code>&lt;provider
          android:name="com.example.tools.DatabaseContentProvider"
          android:authorities="com.example.pro.contentprovider"
          android:exported="false"
          android:grantUriPermissions="true"&gt;
      &lt;grant-uri-permission android:pathPattern=".*" /&gt;
  &lt;/provider&gt;
  </code></pre>