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
- Create a new React Native project (any RN version supported by the library).
- Install the library:
npm install react-native-mparticle@2.7.13
- 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.
- Build a release variant:
cd android && ./gradlew assembleRelease
- 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:
- 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.
- 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)
Summary
react-native-mparticle@2.7.13fails to compile on Android because it importscom.mparticle.UserAttributeListener, which was removed incom.mparticle:android-core:6.0.0-rc.1(published to Maven Central on 2026-05-22).The library's Android
build.gradledeclares 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.1and breaks. Consumers who had a successful build yesterday are now broken with no code change on their side.Reproduction
com.mparticle:android-coreinapp/build.gradle— the failure is independent of what the host app pins, becausereact-native-mparticle's own subproject resolves itscompileOnlyrange separately.:react-native-mparticle:compileReleaseJavaWithJavac.Expected
Library compiles against a known-good mParticle Android Core version.
Actual
Source:
android/src/main/java/com/mparticle/react/MParticleModule.java:41,144,145.Root cause
Two issues compound:
MParticleModule.javausescom.mparticle.UserAttributeListener, which is no longer present in the 6.x line ofcom.mparticle:android-core.[5.9.3, )lets Gradle silently jump across major versions (and into pre-releases like6.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):
compileOnly 'com.mparticle:android-core:[5.9.3, 6.0.0)'Long-term:
MParticleModule.javato the replacement API incom.mparticle:android-core6.x (e.g.UserAttributeListenerAsync/UserAttributeListenerSync, per the SDK's deprecation history).react-native-mparticlepinned against a specific tested major.Workaround for affected consumers
Force-pin the SDK in the host app's root
android/build.gradle:Environment
react-native-mparticle: 2.7.13com.mparticle:android-coreresolved: 6.0.0-rc.1 (published 2026-05-22)build.gradle)