Skip to content

fix: bound android kit upper version in expo config plugin#332

Merged
jamesnrokt merged 1 commit into
mainfrom
fix/bound-android-kit-version-range
May 28, 2026
Merged

fix: bound android kit upper version in expo config plugin#332
jamesnrokt merged 1 commit into
mainfrom
fix/bound-android-kit-version-range

Conversation

@jamesnrokt
Copy link
Copy Markdown
Contributor

Summary

  • The expo config plugin emits implementation "com.mparticle:${kit}:+" for each entry in androidKits. The :+ resolver pulls the newest available version on Maven Central — currently 6.0.0-rc.1.
  • That kit transitively requires com.mparticle:android-core:6.0.0-rc.1, which overrides the bridge's api 'com.mparticle:android-core:[5.79.0, 6.0)' range via Gradle's default conflict resolution (highest-required-version wins).
  • The bridge AAR is compiled against 5.x core, but the app's runtime classpath ends up on 6.x core where several referenced classes no longer exist, producing NoClassDefFoundError at 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 prebuild an app with androidKits configured and confirm app/build.gradle emits a bounded version range instead of :+.
  • ./gradlew :app:dependencies --configuration debugRuntimeClasspath resolves android-core and android-rokt-kit to a 5.x version.
  • App launches without NoClassDefFoundError on classes from com.mparticle.rokt.
  • Existing plugin unit tests pass.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 28, 2026 18:31
@jamesnrokt jamesnrokt requested a review from a team as a code owner May 28, 2026 18:31
@cursor
Copy link
Copy Markdown

cursor Bot commented May 28, 2026

PR Summary

Low Risk
Single-line dependency template change in the config plugin; reduces classpath drift risk without touching auth or runtime app logic.

Overview
The Expo Android config plugin no longer writes unbounded implementation "com.mparticle:${kit}:+" lines for each androidKits entry. It now emits [5.79.0, 6.0), aligned with how the bridge pins android-core, so Gradle cannot resolve a 6.x pre-release kit that forces a newer core and causes NoClassDefFoundError at runtime against the 5.x-compiled bridge.

Reviewed by Cursor Bugbot for commit 9db4dbc. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread plugin/src/withMParticleAndroid.ts
Comment thread plugin/src/withMParticleAndroid.ts
@jamesnrokt jamesnrokt merged commit c84d03a into main May 28, 2026
12 checks passed
@jamesnrokt jamesnrokt deleted the fix/bound-android-kit-version-range branch May 28, 2026 19:04
@rokt-releases rokt-releases Bot mentioned this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants