fix(android): implement getDelegate() on ViewManagers missing it#4228
Merged
Conversation
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.
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.
Fixes #4194.
27 ViewManagers implement the codegen-generated
*ManagerInterfacebut didn't overridegetDelegate()to return the corresponding*ManagerDelegate. Since RN 0.79 (facebook/react-native#49414), this logs aReactNoCrashSoftExceptionon every component mount and falls back to reflection-based property setting viaViewManagerPropertyUpdater.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 isRNMBXMarkerViewContent. The interface has no props soTis never used in any method — zero runtime effect, but the mismatch prevented wiring up the delegate.Verified on Android 14 emulator / RN 0.84:
E ViewManager: ReactNoCrashSoftException: ViewManager using codegen must override getDelegate method (name: RNMBXCamera/RNMBXShapeSource/RNMBXCircleLayer/...)on every mountWhether this is the root cause of the freeze reported in #4194 on Android 16 is unconfirmed — the SoftExceptions are real and worth fixing regardless.