Skip to content

New 6.0.0-rc.1 broke Android builds in React Native #710

@brunofurmon

Description

@brunofurmon

Summary

react-native-mparticle@2.7.13 fails to compile on Android because it imports com.mparticle.UserAttributeListener, which was removed in com.mparticle:android-core:6.0.0-rc.1 (published to Maven Central on 2026-05-22).

The library's Android build.gradle declares its mParticle dependency with an open-ended dynamic version range:

compileOnly 'com.mparticle:android-core:[5.9.3, )'

Gradle's dynamic version resolution picks the highest available version — including pre-releases — so every fresh build now pulls in 6.0.0-rc.1 and breaks. Consumers who had a successful build yesterday are now broken with no code change on their side.

Reproduction

  1. Create a new React Native project (any RN version supported by the library).
  2. Install the library:
    npm install react-native-mparticle@2.7.13
  3. Add a minimal mParticle initialization in the host Android app (per the README). Pin any version of com.mparticle:android-core in app/build.gradle — the failure is independent of what the host app pins, because react-native-mparticle's own subproject resolves its compileOnly range separately.
  4. Build a release variant:
    cd android && ./gradlew assembleRelease
  5. Build fails during :react-native-mparticle:compileReleaseJavaWithJavac.

Expected

Library compiles against a known-good mParticle Android Core version.

Actual

error: cannot find symbol
import com.mparticle.UserAttributeListener;
                    ^
  symbol:   class UserAttributeListener
  location: package com.mparticle

error: cannot find symbol
            selectedUser.getUserAttributes(new UserAttributeListener() {
                                               ^
  symbol:   class UserAttributeListener
  location: class MParticleModule

error: method does not override or implement a method from a supertype
                @Override
                ^
3 errors

Source: android/src/main/java/com/mparticle/react/MParticleModule.java:41,144,145.

Root cause

Two issues compound:

  1. Removed API still referenced. MParticleModule.java uses com.mparticle.UserAttributeListener, which is no longer present in the 6.x line of com.mparticle:android-core.
  2. Unbounded dynamic version range. The dependency declaration [5.9.3, ) lets Gradle silently jump across major versions (and into pre-releases like 6.0.0-rc.1). Any breaking change in a future major release will retroactively break every existing consumer of this library version.

Suggested fix

Short-term (unblocks consumers immediately):

  • Cap the version range to the last known-compatible major:
    compileOnly 'com.mparticle:android-core:[5.9.3, 6.0.0)'

Long-term:

  • Migrate the listener usage in MParticleModule.java to the replacement API in com.mparticle:android-core 6.x (e.g. UserAttributeListenerAsync / UserAttributeListenerSync, per the SDK's deprecation history).
  • Cut a new release of react-native-mparticle pinned against a specific tested major.

Workaround for affected consumers

Force-pin the SDK in the host app's root android/build.gradle:

allprojects {
    configurations.all {
        resolutionStrategy {
            force 'com.mparticle:android-core:5.79.0'
        }
    }
}

Environment

  • react-native-mparticle: 2.7.13
  • com.mparticle:android-core resolved: 6.0.0-rc.1 (published 2026-05-22)
  • Gradle: 7.x / 8.x (any version that supports dynamic ranges — i.e. all of them)
  • Android Gradle Plugin: 7.4.2 (per the library's build.gradle)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions