title: Gradle merge wrapper/sub-module's Android manifest into a main module's manifest
body: <p>I have the following modules inside my project for which I cannot get Gradle to merge the Android manifests properly:</p>
  
  <pre><code>myproject_alpha
  myproject_beta
  myproject_lib
  myproject_release
  </code></pre>
  
  <p>The *_lib module is the main module for the project that contains all source code. The other 3 modules are "wrapper modules" that make slight modifications to the content providers' "authorities" parameter, change the "data" field inside an activity's intent filter specified in the *_lib module's manifest, plus enable some other activities not present in myproject_release module.</p>
  
  <p>Currently, I have gradle Android manifest merging errors between alpha (or beta or release) vs lib. For example, between lib and alpha I see the following 2 gradle errors:</p>
  
  <pre><code>Trying to merge incompatible /manifest/application/provider[@name=com.myproject.contentprovider.MyProvider] element:
    &lt;provider
  --    @android:authorities="com.myproject.alpha.provider"
    &lt;provider
  ++    @android:authorities="com.myproject.lib.provider"
  
  :myproject_alpha:processDebugManifest FAILED
  
  Trying to merge incompatible /manifest/application/activity[@name=com.myproject.activity.LoginActivity] element:
    &lt;activity
    @android:name="com.myproject.activity.LoginActivity"
            @android:name="android.intent.action.MAIN"&gt;
            @android:name="android.intent.category.LAUNCHER"&gt;
    &lt;intent-filter&gt;
            @android:name="android.intent.action.VIEW"&gt;
            @android:name="android.intent.category.BROWSABLE"&gt;
            @android:name="android.intent.category.DEFAULT"&gt;
        &lt;data
  --            @android:host="myhost.test.com"
    &lt;activity
    @android:name="com.myproject.LoginActivity"
            @android:name="android.intent.action.MAIN"&gt;
            @android:name="android.intent.category.LAUNCHER"&gt;
    &lt;intent-filter&gt;
            @android:name="android.intent.action.VIEW"&gt;
            @android:name="android.intent.category.BROWSABLE"&gt;
            @android:name="android.intent.category.DEFAULT"&gt;
        &lt;data
  ++            @android:host="myhost.com"
  
  :myproject_alpha:processDebugManifest FAILED
  </code></pre>
  
  <p>The only similar question I found was<br>
  <a href="https://stackoverflow.com/questions/18708076/gradle-how-to-merge-android-manifest-files-for-different-buildtypes-which-need">Gradle: How to merge Android manifest files for different buildTypes which need the same Activity, but with different intent-filters</a>. However, it doesn't really match my issue because in my case "lib" and "alpha" are interdependent modules not different builds. I'll appreciate some feedback.</p>