title: How can I have a different package name for debug and release in a library module?
body: <p><strong>Short question</strong>:</p>
  
  <p>How can I change the package name for <strong>debug</strong> or <strong>release</strong> build type in a library module?</p>
  
  <p><strong>Context</strong>:</p>
  
  <p>In an Android project with MVP + Clean architecture, we have the repository pattern in a library module. We want to include Firebase on that library with two environments (development and production). </p>
  
  <p>I already created the project in Firebase (<code>com.example.com</code> and <code>com.example.com.dev</code>) and then downloaded the respective <code>google-services.json</code> to src/main and src/debug folders.</p>
  
  <p>Gradle <strong>google-services</strong> plugin validates the module package name with the client ID defined in the <strong>google-services.json</strong>, but Android restrict to change the <code>applicationId</code> in a library (I can't find the technical reason why)</p>
  
  <p><strong>Things that I tried</strong>:</p>
  
  <ul>
  <li>Have two AndroidManifest.xml with different package property. <code>com.example.com</code> in the src/main and <code>com.example.com.dev</code> in src/debug/ but the second one it is just ignored</li>
  <li>Set <code>manifest.srcFile</code> in Gradle sourceSets. The file is in the list when I run <code>./gradlew sourceSets</code> but the package name doesn't change</li>
  <li>Two different flavors in the library module and set different manifests for each one. The package anyway doesn't change.</li>
  </ul>
  
  <p>At this moment I have just two suitable solutions: 
  1. Keep the Firebase setup and implementation in the app module outside of the repository.
  2. Have only one environment for Firebase.  </p>
  
  <p>Thanks a lot for any help or advice. </p>
  
  <p><strong><em>EDIT</em></strong>:</p>
  
  <p>Consider that I need to modify the package in a module (library), not in the app. For some weird reason Gradle shows this error when I try to use <code>applicationIdSuffix</code> or <code>applicationId</code> in a module:</p>
  
  <p>ERROR: Library projects cannot set applicationIdSuffix.</p>