Skip to content

fix(android): implement getDelegate() on ViewManagers missing it#4228

Merged
mfazekas merged 2 commits into
mainfrom
fix/android-get-delegate
Jun 14, 2026
Merged

fix(android): implement getDelegate() on ViewManagers missing it#4228
mfazekas merged 2 commits into
mainfrom
fix/android-get-delegate

Conversation

@mfazekas

@mfazekas mfazekas commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #4194.

27 ViewManagers implement the codegen-generated *ManagerInterface but didn't override getDelegate() to return the corresponding *ManagerDelegate. Since RN 0.79 (facebook/react-native#49414), this logs a ReactNoCrashSoftException on every component mount and falls back to reflection-based property setting via ViewManagerPropertyUpdater.

The fix is pure boilerplate — each manager gets a delegate field and a getDelegate() override, exactly like the managers that already had it (RNMBXMapViewManager, RNMBXCameraGestureObserverManager, etc.).

Also fixes a pre-existing type error in RNMBXMarkerViewContentManager: it implemented ...Interface<RNMBXMarkerView> but its view type is RNMBXMarkerViewContent. The interface has no props so T is never used in any method — zero runtime effect, but the mismatch prevented wiring up the delegate.

Verified on Android 14 emulator / RN 0.84:

  • Before: E ViewManager: ReactNoCrashSoftException: ViewManager using codegen must override getDelegate method (name: RNMBXCamera/RNMBXShapeSource/RNMBXCircleLayer/...) on every mount
  • After: no SoftExceptions

Whether this is the root cause of the freeze reported in #4194 on Android 16 is unconfirmed — the SoftExceptions are real and worth fixing regardless.

26 ViewManagers implemented the codegen-generated *ManagerInterface but
didn't override getDelegate() to return the corresponding *ManagerDelegate.
Since RN 0.79 (PR #49414) this logs a SoftException per mount and falls
back to reflection-based property setting, which fails silently on some
devices (reported as full app freeze on Android 16).
… getDelegate

The manager implemented RNMBXMarkerViewContentManagerInterface<RNMBXMarkerView>
but its view type is RNMBXMarkerViewContent. The interface has no props so T is
never used in any method — no runtime effect, but the type mismatch blocked
wiring up the codegen delegate.
@mfazekas mfazekas merged commit 591e248 into main Jun 14, 2026
7 checks passed
@mfazekas mfazekas deleted the fix/android-get-delegate branch June 14, 2026 08:44
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.

[Bug]: Android app completely frozen on Android 16 — ViewManagers missing getDelegate override

1 participant