From 9db4dbc4f92c8f5c0608eeae32ad16ef326880fb Mon Sep 17 00:00:00 2001 From: James Newman Date: Thu, 28 May 2026 14:19:16 -0400 Subject: [PATCH] fix: bound android kit upper version in expo config plugin 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) --- plugin/src/withMParticleAndroid.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/src/withMParticleAndroid.ts b/plugin/src/withMParticleAndroid.ts index a487da8..5c43b60 100644 --- a/plugin/src/withMParticleAndroid.ts +++ b/plugin/src/withMParticleAndroid.ts @@ -364,9 +364,12 @@ const withMParticleAppBuildGradle: ConfigPlugin = ( } // Generate kit dependency lines - // Use + for version to auto-match core SDK version + // Bounded range matches the core SDK range in android/build.gradle so the + // kit and core stay paired on a 5.x line. An unbounded `+` would resolve + // to a pre-release (e.g. 6.0.0-rc.1) and transitively drag the core past + // the bridge's compiled-against API surface. const kitDependencies = props.androidKits - .map(kit => ` implementation "com.mparticle:${kit}:+"`) + .map(kit => ` implementation "com.mparticle:${kit}:[5.79.0, 6.0)"`) .join('\n'); // Use mergeContents for idempotent injection