I'm having problem with manifest merger with duplicated receivers but the content is different. I use the following receivers for different API levels, had no issue so far until merger. Build fails due to merger which says
Element receiver#.receivers.UpdateReceiver duplicated with element declared at AndroidManifest.xml:124:9
I don't want to create another receiver and continue with this schema. Is there any way to disable merger for those situations or merge the receivers in one but with the option of enabling action with different intent?
<receiver
android:name=".receivers.UpdateReceiver"
android:enabled="@bool/is_api_below_12">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
<receiver
android:name=".receivers.UpdateReceiver"
android:enabled="@bool/is_api_12_and_above">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
perhaps you can set
android {
useOldManifestMerger true
}
in your build.gradle file and this worked fine in my project you can see more details here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With