react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Trying to remove a view index above child count

Open priyankverma opened this issue 4 years ago • 23 comments

Hello, I am facing the Issue "trying to remove a view index above child count" on version "react-native": "0.62.2"

It only fails in production mode that too only on Android devices. And yes I am not Using onLayoutAnimations anywhere in the application

The Error details can be found here: com.facebook.react.uimanager.IllegalViewOperationException: Trying to remove a view index above child count 3 view tag: 2609 detail: View tag:2609 children(2): [ 2593,2597, ], indicesToRemove(1): [ 3, ], tagsToDelete(1): [ 2607, ]

at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:435)
at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:206)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:792)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:903)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2400(UIViewOperationQueue.java:43)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:963)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:693)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

priyankverma avatar May 15 '20 15:05 priyankverma

I am also facing the same issue. It only fails in production mode. "react-native": "0.61.4".

Error:

com.facebook.react.uimanager.IllegalViewOperationException · Trying to remove a view index above child count 0 view tag: 275 detail: View tag:275 children(0): [ ], indicesToRemove(1): [ 0, ], tagsToDelete(1): [ 677, ].

sonam1409 avatar May 29 '20 02:05 sonam1409

your post are unreadable. Format and add information, I'll read them again.

fabOnReact avatar May 29 '20 07:05 fabOnReact

com.facebook.react.uimanager.IllegalViewOperationException: Trying to remove a view index above child count 3 view tag: 2609
 detail: View tag:2609
  children(2): [
2593,2597,
 ],
  indicesToRemove(1): [
3,
 ],
  tagsToDelete(1): [
2607,
 ]

    at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:435)
    at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:206)
    at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:792)
    at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:903)
    at com.facebook.react.uimanager.UIViewOperationQueue.access$2400(UIViewOperationQueue.java:43)
    at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:963)
    at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
    at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
    at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947)
    at android.view.Choreographer.doCallbacks(Choreographer.java:761)
    at android.view.Choreographer.doFrame(Choreographer.java:693)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6669)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

priyankverma avatar May 29 '20 08:05 priyankverma

@fabriziobertoglio1987 Please find the below whole error details :

com.facebook.react.uimanager.IllegalViewOperationException · Trying to remove a view index above child count 0 view tag: 3005 detail: View tag:3005 children(0): [ ], indicesToRemove(1): [ 0, ], tagsToDelete(1): [ 3165, ]

NativeViewHierarchyManager.java:434com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren UIViewOperationQueue.java:205com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute UIViewOperationQueue.java:779com.facebook.react.uimanager.UIViewOperationQueue$1.run UIViewOperationQueue.java:888com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches UIViewOperationQueue.java:42com.facebook.react.uimanager.UIViewOperationQueue.access$2200 UIViewOperationQueue.java:948com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded GuardedFrameCallback.java:28com.facebook.react.uimanager.GuardedFrameCallback.doFrame ReactChoreographer.java:174com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame ChoreographerCompat.java:84com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame Choreographer.java:994android.view.Choreographer$CallbackRecord.run Choreographer.java:794android.view.Choreographer.doCallbacks Choreographer.java:725android.view.Choreographer.doFrame Choreographer.java:981android.view.Choreographer$FrameDisplayEventReceiver.run Handler.java:883android.os.Handler.handleCallback Handler.java:100android.os.Handler.dispatchMessage Looper.java:237android.os.Looper.loop ActivityThread.java:7811android.app.ActivityThread.main Method.java:-2java.lang.reflect.Method.invoke RuntimeInit.java:493com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run ZygoteInit.java:1076com.android.internal.os.ZygoteInit.main

sonam1409 avatar May 29 '20 15:05 sonam1409

I also got this error in version 0.63.1. There is a solution?

valery-lavrik avatar Jul 21 '20 08:07 valery-lavrik

@sonam1409 to fix runtime errors in react-native sourcecode we need:

  1. the developer needs to reproduce his issue in a Minimal Reproducible Example
  2. We need to debug the sourcecode to find an issue

Thanks Best Regards Fabrizio Bertoglio

fabOnReact avatar Jul 21 '20 08:07 fabOnReact

:warning: Missing Required Fields
:information_source: It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a new issue is created. Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one.

github-actions[bot] avatar Aug 19 '20 00:08 github-actions[bot]

:warning: Missing Reproducible Example
:information_source: It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

github-actions[bot] avatar Aug 19 '20 00:08 github-actions[bot]

:warning: Missing Environment Information
:information_source: Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

github-actions[bot] avatar Aug 19 '20 00:08 github-actions[bot]

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

stale[bot] avatar Dec 25 '20 20:12 stale[bot]

I observe this issue in my project using RN 0.63.2

System:
    OS: macOS 11.2.3
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 18.88 GB / 64.00 GB
    Shell: 5.0.18 - /usr/local/bin/bash
  Binaries:
    Node: 12.19.0 - ~/.nvm/versions/node/v12.19.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.5.4 - ~/.nvm/versions/node/v12.19.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 27, 28, 29
      Build Tools: 23.0.1, 23.0.2, 23.0.3, 24.0.0, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 27.0.2, 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.0, 29.0.2, 29.0.3
      System Images: android-18 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6308749
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_275 - /usr/bin/javac
    Python: 2.7.16 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.2 => 0.63.2
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

tszajna0 avatar Apr 12 '21 08:04 tszajna0

Also seeing this on RN 0.64.1, only in the release build. It is not deterministic as far as I can tell. I'm not sure it's possible to make a minimal reproduction of this issue since there doesn't appear to be a clear case in which it arises. It appears random and only in release builds on user's devices which makes it significantly harder to analyze.

Somebody familiar with the native Android code having a look at possible situations where this could arise would likely be the best way to start figuring out a resolution for this.

evelant avatar May 22 '21 14:05 evelant

1624276900886 I am facing the same issue on my react native application, It keeps on showing this error

HamzaMunir26 avatar Jun 21 '21 12:06 HamzaMunir26

@fabriziobertoglio1987 @mojodna @augustl @jsierles @sharnik

HamzaMunir26 avatar Jun 21 '21 12:06 HamzaMunir26

Hit that issue as well. Any update on that? Or workaround?

chtoosha avatar Jul 09 '21 18:07 chtoosha

I have found a workaround that worked for me

On Fri, 9 Jul 2021, 11:21 pm Sasha Kuchaiev, @.***> wrote:

Hit that issue as well. Any update on that? Or workaround?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/28905#issuecomment-877373035, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASLNXNV3SCCCNEWMK7TDJ7LTW44Z3ANCNFSM4NBVTH6A .

HamzaMunir26 avatar Jul 09 '21 18:07 HamzaMunir26

I have found a workaround that worked for me On Fri, 9 Jul 2021, 11:21 pm Sasha Kuchaiev, @.***> wrote: Hit that issue as well. Any update on that? Or workaround? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#28905 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASLNXNV3SCCCNEWMK7TDJ7LTW44Z3ANCNFSM4NBVTH6A .

How?

chtoosha avatar Jul 09 '21 19:07 chtoosha

So basically in my scenario it was crashing on map and I solved it by giving the Key prop to it

On Sat, 10 Jul 2021, 12:55 am Sasha Kuchaiev, @.***> wrote:

I have found a workaround that worked for me … <#m_878680268158964415_> On Fri, 9 Jul 2021, 11:21 pm Sasha Kuchaiev, @.***> wrote: Hit that issue as well. Any update on that? Or workaround? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#28905 (comment) https://github.com/facebook/react-native/issues/28905#issuecomment-877373035>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASLNXNV3SCCCNEWMK7TDJ7LTW44Z3ANCNFSM4NBVTH6A .

How?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/28905#issuecomment-877422242, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASLNXNTCUF3LCL2EOXPVTXTTW5H2VANCNFSM4NBVTH6A .

HamzaMunir26 avatar Jul 09 '21 20:07 HamzaMunir26

giving the Key prop to it

giving key to the flatlist component

adminfyy avatar Oct 21 '21 01:10 adminfyy

Giving key doesn't work too Tried removing this but it's not a perfect solution

if (Platform.OS === 'android') {
        if (UIManager.setLayoutAnimationEnabledExperimental) {
            UIManager.setLayoutAnimationEnabledExperimental(true)
        }
}

rohan-choudhary avatar Mar 09 '22 10:03 rohan-choudhary

If you are using ListFooterComponent or ListHeaderComponent don't render a false value (null, undefined, ...etc) , for that case, returns a Fragment (<></>)

This resolved my problem.

Example Wrong: ListFooterComponent={showFooter && <Footer {...footerProps} />} Correct: ListFooterComponent={showFooter ? <Footer {...footerProps} /> : <></>}

JoseK21 avatar May 16 '22 16:05 JoseK21

In my case, adding the style {borderWidth: 1} to a parent View in a hierarchy of views made the error go away. I don’t know why. I just stumbled on it when trying to find the cause of the error...

handoff avatar Jul 18 '22 10:07 handoff

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

github-actions[bot] avatar Mar 09 '23 12:03 github-actions[bot]

This issue was closed because the author hasn't provided the requested feedback after 7 days.

github-actions[bot] avatar Mar 16 '23 12:03 github-actions[bot]