fix: bound android kit upper version in expo config plugin#332
Conversation
The plugin emitted `implementation "com.mparticle:${kit}:+"` for each
androidKit. The unbounded `+` resolves to the newest version on Maven
Central (currently a 6.0.0-rc.1 pre-release), which transitively
requires `com.mparticle:android-core:6.0.0-rc.1` and overrides the
bridge's `[5.79.0, 6.0)` range on the app's runtime classpath. The
bridge AAR is compiled against the 5.x API surface, so several
referenced classes (e.g. `com.mparticle.rokt.RoktEmbeddedView`,
`com.mparticle.UserAttributeListener`, `com.mparticle.MpRoktEventCallback`)
are absent at runtime and the app crashes at launch with
NoClassDefFoundError.
Bound the kit dependency to the same `[5.79.0, 6.0)` range used for the
core SDK in android/build.gradle so the pair stays in lockstep on the
5.x line.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 9db4dbc. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Expo config plugin’s generated Android kit dependencies to avoid Gradle resolving mParticle kits (and transitively android-core) to 6.x prereleases that are incompatible with the bridge’s 5.x-compiled API surface.
Changes:
- Replace unbounded
:+Android kit dependencies with a bounded[5.79.0, 6.0)range to keep kits aligned with the core SDK’s supported major version. - Add clarifying comments explaining why the bounded range is required to prevent runtime
NoClassDefFoundErrors.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
implementation "com.mparticle:${kit}:+"for each entry inandroidKits. The:+resolver pulls the newest available version on Maven Central — currently6.0.0-rc.1.com.mparticle:android-core:6.0.0-rc.1, which overrides the bridge'sapi 'com.mparticle:android-core:[5.79.0, 6.0)'range via Gradle's default conflict resolution (highest-required-version wins).NoClassDefFoundErrorat launch (e.g.com/mparticle/rokt/RoktEmbeddedView).This change bounds the kit dependency to the same
[5.79.0, 6.0)range used for the core SDK, so kit resolution stays inside the 5.x line that the bridge is built against.Test plan
expo prebuildan app withandroidKitsconfigured and confirmapp/build.gradleemits a bounded version range instead of:+../gradlew :app:dependencies --configuration debugRuntimeClasspathresolvesandroid-coreandandroid-rokt-kitto a 5.x version.NoClassDefFoundErroron classes fromcom.mparticle.rokt.🤖 Generated with Claude Code