Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to remove a view index above child count #28905

Closed
priyankverma opened this issue May 15, 2020 · 24 comments
Closed

Trying to remove a view index above child count #28905

priyankverma opened this issue May 15, 2020 · 24 comments
Labels
Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Needs: Issue Template This issue does not make use of the Issue Template, and may be missing necessary information. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@priyankverma
Copy link

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)
@sonam1409
Copy link

sonam1409 commented May 29, 2020

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, ].

@fabOnReact
Copy link
Contributor

fabOnReact commented May 29, 2020

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

@priyankverma
Copy link
Author

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)

@sonam1409
Copy link

@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

@valery-lavrik
Copy link

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

@fabOnReact
Copy link
Contributor

@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

@chrisglein chrisglein added Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Needs: Issue Template This issue does not make use of the Issue Template, and may be missing necessary information. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Needs: Triage 🔍 labels Aug 19, 2020
@github-actions
Copy link

⚠️ Missing Required Fields
ℹ️ 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
Copy link

⚠️ Missing Reproducible Example
ℹ️ 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
Copy link

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

@stale
Copy link

stale bot commented Dec 25, 2020

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 stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 25, 2020
@tszajna0
Copy link
Contributor

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

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 12, 2021
@evelant
Copy link

evelant commented May 22, 2021

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.

@HamzaMunir26
Copy link

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

@HamzaMunir26
Copy link

HamzaMunir26 commented Jun 21, 2021

@fabriziobertoglio1987 @mojodna @augustl @jsierles @sharnik

@chtoosha
Copy link

chtoosha commented Jul 9, 2021

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

@HamzaMunir26
Copy link

HamzaMunir26 commented Jul 9, 2021 via email

@chtoosha
Copy link

chtoosha commented Jul 9, 2021

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?

@HamzaMunir26
Copy link

HamzaMunir26 commented Jul 9, 2021 via email

@adminfyy
Copy link

adminfyy commented Oct 21, 2021

giving the Key prop to it

giving key to the flatlist component

@rohan-choudhary
Copy link

rohan-choudhary commented Mar 9, 2022

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)
        }
}

@JoseK21
Copy link

JoseK21 commented May 16, 2022

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} /> : <></>}

@handoff
Copy link

handoff commented Jul 18, 2022

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...

@github-actions
Copy link

github-actions bot commented Mar 9, 2023

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 github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 9, 2023
@github-actions
Copy link

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

@facebook facebook locked as resolved and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Needs: Issue Template This issue does not make use of the Issue Template, and may be missing necessary information. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests