Repository navigation
fix(android): build against RN nightly's deprecated invokeJavaMethod overload - #1119
Merged
hryhoriiK97 merged 2 commits intoNov 2, 2026
Merged
Conversation
…overload The shipped codegen code (includesGeneratedCode) is generated with RN 0.88 and calls invokeJavaMethod with cachedMethodId. RN PR 59619 deprecates that overload, and the library's -Wall -Werror turns the warning into a build failure on the 0.89 nightly. Keep deprecations as warnings until 0.89 is the minimum and generated/ is regenerated. See react/react-native#59619 Co-authored-by: Cursor <cursoragent@cursor.com>
jnowakow
approved these changes
Nov 2, 2026
…ated codegen Co-authored-by: Cursor <cursoragent@cursor.com>
hryhoriiK97
deleted the
fix/android-rn-nightly-deprecated-invoke-java-method
branch
November 2, 2026 09:24
4 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is a temporary fix to unblock the RN 0.89 nightly. It only stops the deprecation
warning from failing the build; the shipped Java glue still calls the deprecated
invokeJavaMethodoverload, and the flag stops helping once RN removes it.The follow-up is to stop shipping pre-generated codegen (
includesGeneratedCode: false),so each app generates this code with its own RN version, and then remove the flag.
What/Why?
The Android nightly test in react-native-community/nightly-tests started failing on
0.89.0-nightly-20261031(run):We ship pre-generated codegen code (
includesGeneratedCode: true), generated with RN 0.88's codegen.It calls
JavaTurboModule::invokeJavaMethodwithcachedMethodId, whichfacebook/react-native#59619 deprecates.
target_compile_reactnative_optionsbuilds the library with-Wall -Werror, so the warning fails the build.Regenerating with the nightly's codegen isn't an option yet: the new overload doesn't exist in 0.88.
This keeps deprecations as warnings for the codegen library, so it builds on both 0.88 and 0.89.
The behaviour is the same: the deprecated overload forwards to the new one and no longer uses
cachedMethodID.A TODO marks when to remove the flag: once 0.89 is the minimum and
generated/is regenerated,and before RN removes the deprecated overload. The flag can't work around that removal.
iOS is not affected; the iOS nightly job passes.
Testing
assembleDebugon RN 0.88assembleDebugonreact-native@nightly@nightlypublish (23:27 UTC) should turn the nightly-tests Android job green.PR Checklist