gaokaikai / react-native-smart-refresh

47 stars 21 forks source link

在ios和安卓真机引入组件时报错 #3

Closed WEI4D closed 3 years ago

WEI4D commented 3 years ago

Invariant Violation: requireNativeComponent: "RNRefreshHeader" was not found in the UIManager.

This error is located at: in RNRefreshHeader (at react-native-smart-refresh/index.js:62) in SmartRefreshHeader (at RefreshAnimateHeader.js:51) in RNSmartRefreshView (at react-native-smart-refresh/index.js:38) in RCTView (at View.js:34) in View (at react-native-smart-refresh/index.js:35) in SmartRefresh (at RefreshAnimateHeader.js:46) in RefreshAnimateHeader (at Home.tsx:97) in ScrollView (at ScrollView.js:1286) in ScrollView (at Home.tsx:87) in RCTView (at View.js:34) in View (created by Context.Consumer) in RNCViewPager (at PagerView.tsx:152) in PagerView (created by Context.Consumer) in RCTView (at View.js:34) in View (created by Context.Consumer) in WithTheme (created by Tabs) in Tabs (at Home.tsx:172) in RCTView (at View.js:34) in View (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at Home.tsx:153) in RCTView (at View.js:34) in View (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at Home.tsx:152) in HomeScreen (at SceneView.tsx:122) in StaticContainer in StaticContainer (at SceneView.tsx:115) in EnsureSingleNavigator (at SceneView.tsx:114) in SceneView (at useDescriptors.tsx:153) in RCTView (at View.js:34) in View (at CardContainer.tsx:245) in RCTView (at View.js:34) in View (at CardContainer.tsx:244) in RCTView (at View.js:34) in View (at CardSheet.tsx:33) in ForwardRef(CardSheet) (at Card.tsx:573) in RCTView (at View.js:34) in View (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555) in PanGestureHandler (at GestureHandlerNative.tsx:13) in PanGestureHandler (at Card.tsx:549) in RCTView (at View.js:34) in View (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544) in RCTView (at View.js:34) in View (at Card.tsx:538) in Card (at CardContainer.tsx:206) in CardContainer (at CardStack.tsx:619) in RNSScreen (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:120) in Screen (at Screens.tsx:74) in MaybeScreen (at CardStack.tsx:612) in RNSScreenContainer (at src/index.native.tsx:145) in ScreenContainer (at Screens.tsx:50) in MaybeScreenContainer (at CardStack.tsx:494) in CardStack (at StackView.tsx:462) in KeyboardManager (at StackView.tsx:458) in SafeAreaProviderCompat (at StackView.tsx:455) in RCTView (at View.js:34) in View (at GestureHandlerRootView.android.tsx:21) in GestureHandlerRootView (at StackView.tsx:454) in StackView (at createStackNavigator.tsx:87) in StackNavigator (at BottomTabNavigator.tsx:84) in HomeNavigator (at SceneView.tsx:122) in StaticContainer in StaticContainer (at SceneView.tsx:115) in EnsureSingleNavigator (at SceneView.tsx:114) in SceneView (at useDescriptors.tsx:153) in RCTView (at View.js:34) in View (at BottomTabView.tsx:55) in SceneContent (at BottomTabView.tsx:172) in RNSScreen (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:120) in Screen (at ResourceSavingScene.tsx:28) in ResourceSavingScene (at BottomTabView.tsx:166) in RNSScreenContainer (at src/index.native.tsx:145) in ScreenContainer (at BottomTabView.tsx:146) in RCTView (at View.js:34) in View (at BottomTabView.tsx:145) in SafeAreaProviderCompat (at BottomTabView.tsx:144) in BottomTabView (at createBottomTabNavigator.tsx:45) in BottomTabNavigator (at BottomTabNavigator.tsx:33) in BottomTabNavigator (at SceneView.tsx:122) in StaticContainer in StaticContainer (at SceneView.tsx:115) in EnsureSingleNavigator (at SceneView.tsx:114) in SceneView (at useDescriptors.tsx:153) in RCTView (at View.js:34) in View (at CardContainer.tsx:245) in RCTView (at View.js:34) in View (at CardContainer.tsx:244) in RCTView (at View.js:34) in View (at CardSheet.tsx:33) in ForwardRef(CardSheet) (at Card.tsx:573) in RCTView (at View.js:34) in View (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555) in PanGestureHandler (at GestureHandlerNative.tsx:13) in PanGestureHandler (at Card.tsx:549) in RCTView (at View.js:34) in View (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544) in RCTView (at View.js:34) in View (at Card.tsx:538) in Card (at CardContainer.tsx:206) in CardContainer (at CardStack.tsx:619) in RNSScreen (at createAnimatedComponent.js:165) in AnimatedComponent (at createAnimatedComponent.js:215) in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:120) in Screen (at Screens.tsx:74) in MaybeScreen (at CardStack.tsx:612) in RNSScreenContainer (at src/index.native.tsx:145) in ScreenContainer (at Screens.tsx:50) in MaybeScreenContainer (at CardStack.tsx:494) in CardStack (at StackView.tsx:462) in KeyboardManager (at StackView.tsx:458) in SafeAreaProviderCompat (at StackView.tsx:455) in GestureHandlerRootView (at GestureHandlerRootView.android.tsx:26) in GestureHandlerRootView (at StackView.tsx:454) in StackView (at createStackNavigator.tsx:87) in StackNavigator (at navigation/index.tsx:115) in RootNavigator (at navigation/index.tsx:30) in EnsureSingleNavigator (at BaseNavigationContainer.tsx:409) in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91) in ThemeProvider (at NavigationContainer.tsx:90) in ForwardRef(NavigationContainer) (at navigation/index.tsx:27) in Navigation (at App.tsx:46) in RNCSafeAreaProvider (at SafeAreaContext.tsx:76) in SafeAreaProvider (at App.tsx:43) in RCTView (at View.js:34) in View (created by Portal.Host) in Portal.Host (created by Provider) in ThemeProvider (created by Provider) in LocaleProvider (created by Provider) in Provider (at App.tsx:42) in App (created by ExpoRoot) in ExpoRoot (at renderApplication.js:45) in RCTView (at View.js:34) in View (at AppContainer.js:106) in RCTView (at View.js:34) in View (at AppContainer.js:132) in AppContainer (at renderApplication.js:39)

gaokaikai commented 3 years ago

1.请您下载新的版本 2.删除 node_modules/ 3.清理缓存 重新启动

  1. Please download the new version
  2. Delete node_ modules/
  3. Clean up cache and restart
WEI4D commented 3 years ago

@gaokaikai 1.请您下载新的版本 2.删除 node_modules/ 3.清理缓存 重新启动 完成以上步骤后还是无法正常使用,依然报错。 这是我的package.json { "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "clean": "expo r -c", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", "eject": "expo eject", "test": "jest --watchAll" }, "jest": { "preset": "jest-expo" }, "dependencies": { "@ant-design/react-native": "^4.1.0", "@babel/plugin-transform-flow-strip-types": "^7.14.5", "@expo/metro-config": "^0.1.73", "@expo/react-native-read-more-text": "^1.1.0", "@expo/vector-icons": "^12.0.0", "@react-native-community/masked-view": "0.1.10", "@react-native-community/segmented-control": "^2.2.2", "@react-navigation/bottom-tabs": "5.11.2", "@react-navigation/native": "~5.8.10", "@react-navigation/stack": "~5.12.8", "babel-plugin-import": "^1.13.3", "babel-plugin-inline-import": "^3.0.0", "expo": "~41.0.1", "expo-asset": "~8.3.1", "expo-blur": "^9.0.3", "expo-constants": "~10.1.3", "expo-font": "~9.1.0", "expo-linking": "~2.2.3", "expo-splash-screen": "~0.10.2", "expo-status-bar": "~1.0.4", "expo-step-indicator": "^0.1.2", "expo-web-browser": "~9.1.0", "lottie-react-native": "^4.0.2", "react": "17.0.2", "react-dom": "17.0.2", "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz", "react-native-autoheight-webview": "^1.5.8", "react-native-debugger": "^1.1.0", "react-native-gesture-handler": "~1.10.2", "react-native-mjrefresh": "^0.7.0", "react-native-pager-view": "^5.2.0", "react-native-read-more-text": "^1.1.2", "react-native-reanimated": "~2.1.0", "react-native-render-html": "^5.1.1", "react-native-safe-area-context": "3.2.0", "react-native-screens": "~3.0.0", "react-native-smart-refresh": "^1.1.6", "react-native-smartrefreshlayout": "^0.6.7", "react-native-sticky-parallax-header": "^0.4.0", "react-native-svg": "12.1.0", "react-native-swiper": "^1.6.0", "react-native-tinymce": "^0.1.2", "react-native-web": "~0.13.12", "react-native-webview": "11.2.3" }, "devDependencies": { "@babel/core": "^7.9.0", "@types/react": "~16.9.35", "@types/react-native": "~0.63.2", "jest-expo": "~41.0.0", "typescript": "~4.0.0" }, "private": true }

gaokaikai commented 3 years ago

我们没有针对expo作出改变 我们的库可能只适用于reactnative

WEI4D commented 3 years ago

@gaokaikai 您好,后续是否会支持Expo?

gaokaikai commented 3 years ago

目前我们没有这方面的需求 我们的开发团队并不使用expo 可能后续会有吧