Skip to content

Android crash : Trying to remove a view index above child count #34

@ghost

Description

I am using latest version of this library in React Native. It works well in iOS but crashes with following error in Android

2020-10-16 18:40:53.307 4429-4429/com.project.android E/unknown:ReactNative: Exception in native call
    com.facebook.react.uimanager.IllegalViewOperationException: Trying to remove a view index above child count 25 view tag: 2307
     detail: View tag:2307
      children(23): [
    2167,2175,2177,2179,2187,2189,2623,2207,2209,2217,2219,2223,2229,2249,2633,2265,
    2267,2637,2275,2277,2279,2287,2433,
     ],
      indicesToRemove(1): [
    25,
     ],
      tagsToDelete(1): [
    2433,
     ]

Usage

I am simply calling the toast hook on a button click

const Component = (props) => {
    const { toast } = useToast();

    const handleClick = useCallback(() => {
        toast({
          message: 'Button Clicked',
          intent: 'ERROR',
          hideIcon: true,
          bg: colors.LIGHT_GREY,
          closeButtonBgColor: 'transparent',
        });
    }), [toast])
    return <Button onClick={handleClick} />
} 

Android build settings

ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
        supportLibVersion = "29.0.2"
        ndkVersion = "21.3.6528147"
        kotlin_version = "1.3.72"
        gradleVersion = '4.0.1'
        googleServicesVersion = "4.3.3"
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions