Skip to content

fix(android): build against RN nightly's deprecated invokeJavaMethod overload - #1119

Merged
hryhoriiK97 merged 2 commits into
mainfrom
fix/android-rn-nightly-deprecated-invoke-java-method
Nov 2, 2026
Merged

hryhoriiK97 merged 2 commits into
mainfrom
fix/android-rn-nightly-deprecated-invoke-java-method

Conversation

@hryhoriiK97

@hryhoriiK97 hryhoriiK97 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

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
invokeJavaMethod overload, 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):

EnrichedMarkdownTextSpec-generated.cpp:17:54: error: 'invokeJavaMethod' is deprecated: Use the overload without cachedMethodID [-Werror,-Wdeprecated-declarations]

We ship pre-generated codegen code (includesGeneratedCode: true), generated with RN 0.88's codegen.
It calls JavaTurboModule::invokeJavaMethod with cachedMethodId, which
facebook/react-native#59619 deprecates.
target_compile_reactnative_options builds 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

  • Example app assembleDebug on RN 0.88
  • Example app assembleDebug on react-native@nightly
  • After merge: the next @nightly publish (23:27 UTC) should turn the nightly-tests Android job green.

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

…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>
…ated codegen

Co-authored-by: Cursor <cursoragent@cursor.com>
@hryhoriiK97
hryhoriiK97 merged commit 4f63a73 into main Nov 2, 2026
19 checks passed
@hryhoriiK97
hryhoriiK97 deleted the fix/android-rn-nightly-deprecated-invoke-java-method branch November 2, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants