title: Using build types in Gradle to run same app that uses ContentProvider on one device
body: <p>I have set up Gradle to add package name suffix to my debug app so I could have release version that I'm using and debug version on one phone. I was referencing this: <a href="http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Types">http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Types</a></p>
  
  <p>My build.gradle file looks like this:</p>
  
  <pre><code>...
  android
  {
      ...
      buildTypes
      {
          debug
          {
              packageNameSuffix ".debug"
              versionNameSuffix " debug"
          }
      }
  }
  </code></pre>
  
  <p>Everything works fine until I start using a ContentProvider in my app. I get: </p>
  
  <pre><code>Failure [INSTALL_FAILED_CONFLICTING_PROVIDER]
  </code></pre>
  
  <p>I understand that this happens because two apps (release and debug) are registering same ContentProvider authority.</p>
  
  <p>I see one possibility to solve this. If I understand correctly, you should be able to specify different files to use when building. Then I should be able to put different authorities in different resource files (and from Manifest set authority as string resource) and tell Gradle to use different resource for debug build. Is that possible? If yes then any hints on how to achieve that would be awesome!</p>
  
  <p>Or maybe it's possible to directly modify Manifest using Gradle? Any other solution on how to run same app with ContentProvider on one device is always welcome.</p>