Skip to content

AAP-18921: RN 0.80 reflection field-name fix (cherry-pick of upstream PR #4812)#5

Open
sriteja777 wants to merge 2 commits intorelease-20.38.0-cloud.1from
aap-18921-rn080-patch
Open

AAP-18921: RN 0.80 reflection field-name fix (cherry-pick of upstream PR #4812)#5
sriteja777 wants to merge 2 commits intorelease-20.38.0-cloud.1from
aap-18921-rn080-patch

Conversation

@sriteja777
Copy link
Copy Markdown
Collaborator

@sriteja777 sriteja777 commented May 4, 2026

Summary

Fixes NoSuchFieldException: mClient on RN 0.80+ by version-branching the Kotlin reflection field names that React Native renamed in 0.80.

Cherry-picks the relevant 2 of 3 Kotlin file changes from upstream wix/Detox PR #4812 (Detox 20.43.0). The 3rd file (AnimatedModuleIdlingResource.kt) doesn't apply because the fork's version is structurally different — it doesn't reflect into mOperations at all.

Bumps version to 20.38.0-cloud.2.

Jira: AAP-18921
Customer FD: 1611572 (group_id 8836399)
Upstream reference: wix/Detox#4812

Behaviour

Runtime version-branched via ReactNativeInfo.rnVersion():

Field RN ≤ 0.79 RN 0.80 RN ≥ 0.81
NetworkingModule.client mClient client client
ReactContext.reactHost mReactHost reactHost reactHost
ReactInstance.javaTimerManager mJavaTimerManager javaTimerManager javaTimerManager
ReactHost.reactInstance mReactInstance mReactInstance reactInstance

Behaviour for RN ≤ 0.79 is identical to before the patch — existing customers unaffected.

Files changed

  • detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/network/NetworkingModuleReflected.kt+11/-2
  • detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/timers/JavaTimersReflected.kt+22/-3
  • detox/package.json — version bump to 20.38.0-cloud.2
  • package.json — version bump to 20.38.0-cloud.2

Test plan

  • :detox:testFullDebugUnitTest — 116/116 pass, build successful
  • npm run build:android — aar publishes cleanly to local Maven repo
  • npm pack — tarball produced (browserstack-detox-20.38.0-cloud.2.tgz, 858 KB)
  • Real-device regressionexamples/demo-react-native (RN 0.77.2) on BS Detox cloud (Pixel 7 / Android 13): both suites pass
  • Real-device fix-path — same demo bumped to RN 0.80.3 / React 19.1.0 / Kotlin 2.1.20 on BS Detox cloud: 3/3 tests pass; patched code path confirmed in test apk dex (FIELD_OKHTTP_CLIENT_PRE80 constant present)
  • Customer to validate against their actual app (FD #1611572) post-publish

Release

Publish via Jenkins DetoxNpmPackagePublish (or manual npm publish from detox/) once approved. Tag 20.38.0-cloud.2.

sriteja777 added 2 commits May 4, 2026 13:20
RN 0.80 renamed several Android-side fields that Detox accesses via
reflection. Cherry-picks upstream wix/Detox PR #4812 onto this fork
so that:

- NetworkingModuleReflected uses `client` for RN >0.79, else `mClient`
- JavaTimersReflected uses `reactHost`/`javaTimerManager` for RN >0.79
  and `reactInstance` for RN >0.80, else the legacy `m*` names

Behaviour is unchanged for RN <=0.79; this unblocks customers on
RN 0.80+ who hit `NoSuchFieldException: mClient` at Detox init.

Bumps version to 20.38.0-cloud.2.

Refs: AAP-18921, wix/Detox#4812
The DetoxNpmPackagePublish Jenkins job (per Confluence Detox Release
Process) is what bumps the version to x.y.z-cloud.X at publish time.
Source on release-20.38.0-cloud.1 has always been "20.38.0" without
the suffix. Reverting the two package.json version changes.

Refs: AAP-18921
@sriteja777 sriteja777 requested review from a team, aditya711-code and darshilgada24 and removed request for a team May 4, 2026 15:03
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