cds-mobile's react-native-navigation-bar-color peer dep breaks Android builds on Gradle 9
- Dominant language
- TypeScript
- Stars
- 505
- Forks
- 105
- Avg merge
- 20h 16m
- Merged PRs (30d)
- 29
Description
`@coinbase/cds-mobile` declares `react-native-navigation-bar-color@^2.0.2` as a peer dependency (used only by `AndroidNavigationBar` / `useAndroidNavigationBarUpdater`, which calls `changeNavigationBarColor`). That library's `android/build.gradle` still has a `buildscript` block calling `jcenter()`. jcenter was shut down in 2021, and Gradle 9 removed the `jcenter()` method entirely, so any app on React Native 0.82+ / Expo SDK 55+ (which ship Gradle 9) fails to build during configuration with `Could not find method jcenter()` on the `:react-native-navigation-bar-color` project.
This is latest as of 9.6.3 — the peer dep is unchanged.
The upstream library looks abandoned: last commit and last npm release were both December 2022 (2.0.2 is the newest version), with 28 open issues and several unmerged PRs, including requests to remove `jcenter()` open since early 2023. So waiting on an upstream release isn't realistic. I've opened a PR against it as a stopgap (thebylito/react-native-navigation-bar-color#72) that removes the dead `buildscript`/`jcenter()` block and adds the AGP 8 `namespace`, but there's no sign it'll be merged or published.
For now consumers have to work around it (e.g. a `patch-package`/`pnpm patch` on the dependency), which isn't great to have to do for a transitive CDS peer dep. It'd be better handled in CDS. A few options:
- Vendor the tiny bit of functionality actually used (`changeNavigationBarColor` is a small native call) so there's no dependency on the abandoned package, or
- Move to a maintained alternative (`react-native-system-navigation-bar`, or `expo-navigation-bar` / the edge-to-edge approach on newer Expo), or
- If you want to stay on the current package, pin to a fork with the jcenter fix.
This is part of getting cds-mobile building cleanly on modern React Native, so it's related to #763 (widening the RN peer range to 0.83.x).
Repro: install `@coinbase/cds-mobile` in an RN 0.82+/Expo SDK 55+ app and run an Android release build (`expo prebuild` + Gradle assemble).
Contributor guide
Research direction
Start by tracing @coinbase/cds-mobile's AndroidNavigationBar and useAndroidNavigationBarUpdater, including the changeNavigationBarColor call and peer-dependency setup. Reproduce with an RN 0.82+/Expo SDK 55+ app using expo prebuild and an Android release build. Done means the modern Gradle configuration succeeds without a consumer patch while the existing navigation-bar behavior remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, react-native, typescript
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100