r/reactnative • • Oct 16 '26

Question Gradle / AGP upgrades when bumping React Native: what do you check first?

When a React Native upgrade forces a Gradle wrapper or Android Gradle Plugin bump, what's your first move?

Do you check JDK compatibility, the wrapper version, plugin versions in third-party libraries, or something else? Any gotchas that took you longer than they should have?

2 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/rushikesh_d_pandit Oct 20 '26

The JDK-vs-wrapper ordering matches my experience: it fails before anything RN-specific runs, and the daemon keeping the old JDK until --stop wastes a lot of time. Does the first-real-error approach hold up when the failure is in a transitive native dependency, or do you still end up bisecting?

1

u/lassieCoder Oct 20 '26

Mostly, yes. It just answers a different question than you'd hope. The first real error tells you which module broke (the failing task names it, e.g. :react-native-foo:compileReleaseKotlin), but with a transitive native dep the module that breaks often isn't the one that caused it.

What I do instead of bisecting:
- Resolution failures: the Could not resolve block includes a Required by: chain. Read it bottom-up and you get the library that pulled the bad coordinate in. If it's not obvious, ./gradlew :app:dependencyInsight --dependency <name> --configuration releaseRuntimeClasspath shows who requests which version and which one won.
- Duplicate class: the error names both artifacts. The fix is usually an exclude or a resolutionStrategy.force, not removing a library.
- CMake/NDK failures inside a library's .cxx folder: the first error is usually accurate (minSdk, NDK version, headers). It's just buried under the ninja output.

Where I still end up bisecting: when the build passes and it fails at runtime (UnsatisfiedLinkError, a .so from two libs built against different RN/NDK versions, or a crash on launch with no useful stack). The build log has nothing to read there, so it's removing libraries until it stops.

For what it's worth, the tool quotes the Required by: chain for resolution failures and points you to ./gradlew :app:dependencies, and it handles duplicate classes, but it won't bisect for you.