fix(android): Unable to update properties for view tag#5216
fix(android): Unable to update properties for view tag#5216ngocle2497 wants to merge 3 commits intosoftware-mansion:mainfrom
Conversation
|
Hi @MasonLe2497,
|
|
@MasonLe2497 Thanks for submitting the PR! I agree we should do something about this error. Instead of checking if the view exists before updating props, maybe we could wrap |
Ok. I'll try tomorrow.(from UTC +7:00) |
|
@tomekzaw i tried to wrap try/catch to mUIImplementation.synchronouslyUpdateViewOnUIThread, but i still catch the issue. Screen.Recording.2023-10-12.at.09.19.45.mov |
Thanks, I just update my PR |
|
Hey @tomekzaw, is there anything else we can do about this? |
|
👀 |
|
@tomekzaw any update? |
| // We need to check current view exist in UIManager or not | ||
| // Sometime, view can be replace, recycle, ... with wrong way (like FlashList) | ||
| // So before update, We need to check view tag exist in UIManager |
| if(view == null) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
| if(view == null) { | |
| return; | |
| } | |
| if (view == null) { | |
| return; | |
| } |
| if(view == null) { | ||
| return; | ||
| } | ||
| } catch (Exception ex) { |
There was a problem hiding this comment.
| } catch (Exception ex) { | |
| } catch (Exception e) { |
| return; | ||
| } | ||
| } catch (Exception ex) { | ||
| Log.d("Reanimated-updateProps", "Skip update props cause viewTag not exist or have been removed!"); |
There was a problem hiding this comment.
Let's remove this warning so that we don't pollute the logs.
| Log.d("Reanimated-updateProps", "Skip update props cause viewTag not exist or have been removed!"); |
| } | ||
| } catch (Exception ex) { | ||
| Log.d("Reanimated-updateProps", "Skip update props cause viewTag not exist or have been removed!"); | ||
| return; |
There was a problem hiding this comment.
Can you please describe in which cases the exception will be thrown?
|
@ngocle2497 do you plan to review the change requests? We really need this in prod. If not, let me know and I'll do it. |
|
@damianbeles @ngocle2497 I opened ticket #5767 to address that important error. |
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary I'm opening this PR to address a critical issue previously tackled by PR #5216, which has stalled due to the original author's inactivity. This fix is crucial for resolving significant bugs affecting Android view property updates (referenced in issues #4505, #4231, #3860) that impact application stability and performance. Typical error : ```unknown:NativeViewHierarchyManager: Unable to update properties for view tag 943 03-07 19:54:33.543 19722 19722 E unknown:NativeViewHierarchyManager: com.facebook.react.uimanager.IllegalViewOperationException: ViewManager for tag 943 could not be found. ``` ## Test plan <!-- Provide a minimal but complete code snippet that can be used to test out this change along with instructions how to run it and a description of the expected behavior. --> ### Before patching https://github.com/software-mansion/react-native-reanimated/assets/40337934/a7cd7f8c-c0a3-4a84-98f7-4853886799f0 ### After patching https://github.com/software-mansion/react-native-reanimated/assets/40337934/c4dfe495-fed9-48cf-a227-e7768cec26cc --------- Co-authored-by: Krzysztof Piaskowy <krzysztof.piaskowy@swmansion.com>
|
Thank you for your pull request and the time you've dedicated to it! I appreciate that 🙌. These changes have been implemented in this PR, so I'll close this one. |
Summary
Platform: Android
I catch this issue when use FlashList with large data and have animated update on each item.
One element can be update/replace/recycle, so view tag can be update/remove too
So, before update props, we check current view tag exist in UIManager or not.
Fix #4505
Fix #4231
Fix #3860
Test plan
Before:
before.mp4
After:
after.mp4