How-To

Duplicate class FirebaseInstanceIdReceiver: CleverTap + Firebase fix

The error means two libraries on your Android build path ship the same class: the old firebase-iid 18.0.0 and firebase-messaging 23.0.6, which now contains it. Use one push SDK, or update, align or exclude the stale firebase-iid dependency, then rebuild from a clean state.

Sohail HussainSohail Hussain7 min read

Short answer

  • The build fails because an old firebase-iid library and a newer firebase-messaging library both contain the same class, and Gradle refuses to pick one.
  • In an OutSystems app with both the CleverTap Cordova plugin and a separate Firebase plugin, remove one of them. The original asker kept CleverTap, which already includes Firebase configuration, and the Android build passed.
  • Outside OutSystems, find the dependency that pulls in firebase-iid and update it, or exclude that artifact as a last resort.

Your Android build stops with this message, while iOS builds fine:

Duplicate class com.google.firebase.iid.FirebaseInstanceIdReceiver found in modules jetified-firebase-iid-18.0.0-runtime (com.google.firebase:firebase-iid:18.0.0) and jetified-firebase-messaging-23.0.6-runtime (com.google.firebase:firebase-messaging:23.0.6)

This is a mobile SDK dependency problem and has nothing to do with email sending or Mailneo. I'm covering it because the message is confusing and the fix is short.

Why the build fails

Gradle assembles an Android app from many libraries, called modules. If two modules contain a class with the same full name, the duplicate-class check fails the build, because the app can ship only one copy.

The message names both modules, and that tells you most of the story:

  • firebase-iid:18.0.0 is the old Firebase Instance ID library. Google's reference says Firebase Instance ID has been replaced by FirebaseInstallations for app instance identifiers and FirebaseMessaging.getToken() for FCM registration tokens.
  • firebase-messaging:23.0.6 is a much newer messaging library. Your error shows FirebaseInstanceIdReceiver inside it, so the receiver now ships there.

So one component in your project asks for the legacy firebase-iid artifact, and another asks for modern firebase-messaging. Both land on the classpath and the class collides. A gap between 18.x and 23.x usually means two plugins written for different eras of Firebase.

The original forum thread reports the same pattern: both the Firebase plugin and the CleverTap Cordova plugin were installed in an OutSystems app, Android failed and iOS did not. That fits, because firebase-iid is an Android Gradle artifact, so iOS never sees the conflict.

Most common causes

CauseSymptomFix
Two push or Firebase plugins installedError appears right after adding the second pluginRemove one (Fix 1)
One plugin pins an old firebase-iidError appears with a single plugin on an old versionUpdate that plugin (Fix 2)
Mixed plugin generationsModule versions differ by several major releasesAlign versions (Fix 2)
Cached build outputError persists after removing a pluginClean and rebuild (Fix 1, last step)

Fix 1: use one push SDK

This applies when you installed a standalone Firebase plugin and the CleverTap Cordova plugin in the same OutSystems mobile app. The thread's solution was to choose one, because CleverTap already includes Firebase configuration.

  1. Decide which plugin owns push. If CleverTap sends your push notifications, keep CleverTap.
  2. Remove the standalone Firebase plugin from the app's extensibility configuration, or from the module that references it.
  3. Check for any other plugin that bundles an older Firebase messaging or instance ID library, and remove or update it.
  4. Confirm where CleverTap expects your Firebase config file (google-services.json). I haven't verified how OutSystems handles that file, so follow CleverTap's own setup documentation for your plugin version.
  5. Generate a fresh Android build instead of reusing a cached one.

Check before you remove

If your app uses the standalone Firebase plugin for something CleverTap does not cover, such as another Firebase feature, removing it will break that feature. In that case use Fix 2 instead.

Fix 2: find the dependency that pulls in firebase-iid

If you need both plugins, make every library agree on a recent Firebase version. In a plain Cordova or native Android project you can see who requests the old artifact:

./gradlew app:dependencies --configuration releaseRuntimeClasspath | grep -B5 firebase-iid

The output shows which plugin depends on firebase-iid. Work through these options, best first:

  1. Update that plugin to a release that targets current Firebase. This is the cleanest fix.
  2. Align versions so everything resolves to one Firebase BOM or one firebase-messaging version.
  3. As a last resort, exclude the stale artifact in Gradle:
configurations.all {
    exclude group: 'com.google.firebase', module: 'firebase-iid'
}

I'd treat the exclude as a stopgap. If a plugin calls old firebase-iid APIs directly, the build may pass and the app may then fail at runtime. Test push registration on a real device afterward.

In OutSystems you generally don't edit Gradle by hand. There, the practical routes are Fix 1, or changing plugin versions in your extensibility settings. Each plugin's release notes should list its compatible versions.

Why old versions keep appearing

Google's Play services release notes list firebase-iid and firebase-messaging artifacts released side by side for years, up to 21.1.0 in April 2021. A plugin built in that period can still request firebase-iid, even though the newer messaging library now carries the receiver class.

Checklist before you try again

  • Only one plugin is responsible for push notifications in the app.
  • No other plugin in the module list bundles an older Firebase messaging or instance ID library.
  • The remaining plugins were released around the same time as each other.
  • The Android build is clean, not reused from a cache.
  • Push registration has been tested on a real Android device, not only an emulator.

How to prevent it

  • Add one plugin per job. Push is the usual offender: Firebase, CleverTap and similar SDKs each want to own messaging.
  • After adding or upgrading any plugin, run an Android build right away, before stacking more changes.
  • Keep plugins on versions released close together, so they share one generation of Firebase.
  • Check iOS and Android builds separately. A green iOS build says nothing about Gradle conflicts.

If nothing works

Contact CleverTap support if the conflict persists with only their plugin installed, or the OutSystems support team and forge component owner if it involves another plugin. Send the full Gradle output (not just the first line), the list of installed plugins with versions, your OutSystems or Cordova version, and which fixes you already tried.

Subject: Android build fails with duplicate class FirebaseInstanceIdReceiver

Hello,

Our Android build fails with:
Duplicate class com.google.firebase.iid.FirebaseInstanceIdReceiver found in modules jetified-firebase-iid-18.0.0-runtime (com.google.firebase:firebase-iid:18.0.0) and jetified-firebase-messaging-23.0.6-runtime (com.google.firebase:firebase-messaging:23.0.6)

iOS builds fine. Installed plugins and versions: {list plugins with versions}
Platform: {OutSystems / Cordova version}
Already tried: removed the standalone Firebase plugin, clean rebuild.

Which plugin versions are compatible with each other, and which one should own push?

Common questions

Why does only Android fail and not iOS?

firebase-iid is an Android Gradle artifact. iOS uses a different dependency system, so the duplicate class never exists there.

Is excluding firebase-iid safe?

It can be. It works when no plugin actually calls the old APIs, and it can crash at runtime when one does. Google marks the instance ID classes as deprecated, so updating the plugin is the safer long-term fix.

Which plugin should I keep, CleverTap or Firebase?

Keep the one that sends your push notifications. In the thread this article is based on, the asker kept CleverTap because it already includes Firebase configuration.

Does this error mean my Firebase setup is broken?

Not necessarily. It means two libraries overlap. Your Firebase project and google-services.json can be fine.

technicalclevertapoutsystemsfirebaseerror-codes
Share this article
Sohail Hussain

Sohail Hussain

Founder & CEO at Mailneo

Building Mailneo — AI-powered email marketing for growing businesses.

Related Articles

How-To

ActiveCampaign n8n error 301 on create contact: causes and fixes

A 301 from the ActiveCampaign node means the request went to a URL that redirects, so start with the API URL in your n8n credential. Copy it from Settings, then Developer, and check the scheme and path. Zapier 403 and cURL error 28 behind Cloudflare have different causes, covered below.

Sohail Hussain|9 min read
How-To

"Stage not on allowlist": Apollo to HubSpot sync fix

The error "Stage not on allowlist" means the contact's Apollo stage is not on the list of stages permitted to push to HubSpot. Open the HubSpot integration in Apollo, go to the Sync tab, and add that stage under "Stages for push contacts". Lifecycle stage mapping is a separate setting.

Sohail Hussain|7 min read
How-To

Salesmate "Authorization with Gmail failed": Gmail IMAP fix

Salesmate shows "Authorization with Gmail failed" when it can't read your Gmail account over IMAP. In Gmail settings, enable IMAP, choose "Do not limit the number of messages in an IMAP folder", and show All Mail in IMAP. Then reconnect the account in Salesmate. Other causes are covered below.

Sohail Hussain|8 min read
How-To

AWeber export "Stop Status" and "Stop Time" columns explained

In an AWeber subscriber export, a non-empty Stop Time and a non-zero Stop Status most likely mean the person has stopped receiving your mail, usually because they unsubscribed. AWeber doesn't explain the columns in the file, so verify against a few known unsubscribes, then import those rows as blocked, not subscribed.

Sohail Hussain|7 min read

Ready to supercharge your email marketing?

Start sending smarter emails with AI-powered campaigns. No credit card required.

Get Started Free