Repository navigation
fix(android): remove adbOptions block that breaks builds on AGP 9 - #430
Conversation
AGP 9.0 removed Installation.installOptions(String...), so apps on React Native 0.87+ (AGP 9.2.1) fail to configure this module with "Could not find method installOptions()". The block only set adb flags for installing this module's own instrumented tests, which do not exist. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PR SummaryLow Risk Overview This resolves Android build failures on Android Gradle Plugin (AGP) 9 (used in React Native 0.87+), where the Reviewed by Cursor Bugbot for commit 03ccbc1. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused removal resolves the AGP 9 configuration failure without affecting production builds.
Review effort: Balanced
Findings: None
What changed in this PR
Removes obsolete Android installation options that prevent builds with AGP 9.
Changes:
- Deletes the unused
adbOptionsblock. - Restores compatibility with React Native 0.87 and AGP 9.
| File | Description |
|---|---|
android/build.gradle |
Removes unsupported test APK installation settings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Why
Android builds fail for apps on React Native 0.87, or on any other setup with AGP 9, that use this package. Gradle stops while it configures
:react-native-mparticle:React Native 0.87 moved to Android Gradle Plugin (AGP) 9.2.1 and Gradle 9.4.1. AGP 9.0 removed the
installOptions(String...)method thatandroid/build.gradlecalls. Every released version of this package has that call, including 3.4.0. CI did not catch it because the sample app is on React Native 0.84 (AGP 8.12) and the module's own build uses AGP 8.1.4. Once this lands, apps on React Native 0.87 build again.Programme
Standalone fix, no programme. It comes from a report of this build failure.
What changes
This deletes the
adbOptions { timeOutInMs …; installOptions "-d","-t" }block fromandroid/build.gradle. The block dates from the first Android commit in 2017. It set adb flags (allow version downgrade, allow test-only APKs, 10-minute timeout) that apply only when Gradle installs this module's own instrumented-test APK. The module has noandroidTestsources and CI runs noconnectedAndroidTest, so nothing used the block, and app builds never did.There is no replacement and no documentation change. The release-draft workflow generates the changelog.
Linked work
None.
Rollout
Path: merging publishes nothing. The fix reaches apps in the next 3.x release of this package, which the release-draft workflow prepares. It takes effect when an app upgrades and rebuilds.
Feature flags: none.
Turning it off: a published version cannot be recalled. Reverting this pull request and releasing again restores the block in the next version.
What we watch: this repository's issues for Android build failures on React Native 0.87 or newer. There is no production dashboard for a client library.
Risks
installDebugbehaves for apps. CI's AGP 8 jobs (Android unit tests, lint, ktlint, sample app) still build the module.:react-native-mparticle.android.builtInKotlin=falseandandroid.newDsl=falseopt-outs still fail, because this module applieskotlin-android. This PR does not address that: React Native's own template app fails the same way without those opt-outs. AGP 10 will remove the opt-outs, so a follow-up is needed (see the notes).Risk class: low.
Who
Written by: an automated coding agent (Claude Code), at an engineer's request.
Code reviewed before opening: an independent review agent reviewed the change before it was committed and passed it.
Design reviewed before opening: the requesting engineer approved deleting the block, and limiting scope to React Native 0.87's default Gradle settings.
Decision this implements: the requesting engineer's approval on 2026-10-02. The record is internal and cannot be linked.
Checked: on 2026-10-02 I built a fresh React Native 0.87.1 app (AGP 9.2.1, Gradle 9.4.1, Kotlin 2.2.0, template
gradle.properties) with this package installed from ayarn dev:packtarball, using./gradlew :app:assembleDebug -PreactNativeArchitectures=arm64-v8a.main, the build fails with the error above.:react-native-mparticle:compileDebugKotlinruns.cd android && ./gradlew test lint ktlintCheck(AGP 8.1.4) passes locally.Not checked:
Size
Hand-written: 0 lines added and 4 removed, in 1 file.
Generated: none.
Notes for reviewers
AGP 9 opt-outs. React Native 0.87's template sets
android.builtInKotlin=falseandandroid.newDsl=false. With those set,apply plugin: 'kotlin-android'andkotlinOptionsstill work, which is why the build first failed at theinstallOptionsline.Removing the opt-outs breaks the build in two places:
Failed to apply plugin 'org.jetbrains.kotlin.android'.apply plugin: 'kotlin-android'withCannot add extension with name 'kotlin'.Supporting built-in Kotlin needs a separate change that keeps AGP 8 working. It would drop
kotlin-androidon AGP 9 and movekotlinOptionstokotlin.compilerOptions.Gradle 10 warning from this module.
--warning-mode allreports the GroovypropName valueassignment syntax, which Gradle 10 removes. The first hit isnamespace 'com.mparticle.react'. React Native's templateapp/build.gradlegets the same warning.🤖 Generated with Claude Code