com.facebook.react.views.progressbar.ReactProgressBarViewManager cannot be cast to com.facebook.react.uimanager.ViewGroupManager

1
open
nkpatnis
nkpatnis
Posted 3 months ago

com.facebook.react.views.progressbar.ReactProgressBarViewManager cannot be cast to com.facebook.react.uimanager.ViewGroupManager #32402

Description

After bundle is loaded this happens (only in Android iOS Working fine) I faced this in 0.65.1 then upgraded to 0.66.0 but in this version also same issue. also I cleaned everything and did fresh install.

React Native version:

info Fetching system and libraries information... System: OS: macOS 11.2.2 CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @2.00GHz Memory: 164.12 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.8.0 - ~/.nvm/versions/node/v16.8.0/bin/node Yarn: Not Found npm: 7.21.0 - ~/.nvm/versions/node/v16.8.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.0 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: API Levels: 21, 23, 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.1, 30.0.2, 30.0.3 System Images: android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.2 AI-202.7660.26.42.7486908 Xcode: 12.5/12E262 - /usr/bin/xcodebuild Languages: Java: 1.8.0_282 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.66.0 => 0.66.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps To Reproduce

After Bundle is loaded its happening (only in Android)

Snack, code example, screenshot, or link to a repository:

Screenshot 2021-10-14 at 1 22 41 PM

import React from 'react';
import {StyleSheet, View, Dimensions} from 'react-native';
import {Text, Button, Card, Block} from '../core';
const screenWidth = Dimensions.get('window').width;

const ModifiedChild = props => {
  if (Array.isArray(props.children)) {
    throw new Error(
      'Only one child is allowed in a Section, You can use fragment',
    );
  }

  // Checking isValidElement is the safe way and avoids a typescript
  // error too.
  if (React.isValidElement(props.children)) {
    return React.cloneElement(props.children, {...props});
  }
  return props.children;
};

export default function Section({children, ...rest}) {
  let [sectionWidth, setSectionWidth] = React.useState(screenWidth);

  return (
    <Block
      middle
      center
      color="white"
      onLayout={event => {
        var {x, y, width, height} = event.nativeEvent.layout;
        setSectionWidth(width);
      }}
      {...rest}>
      <ModifiedChild containerWidth={sectionWidth} children={children} />
    </Block>
  );
}

const styles = StyleSheet.create({});
nkpatnis
nkpatnis
Created 3 months ago

When I moved ActivityIndicator(child) from this parent to not normal View(parent) its working now.