在 UIManager 中找不到 RNCAndroidDropdownPicker

问题描述 投票:0回答:5

我已经安装了nativebase版本2.15.2。我在 android 中遇到以下错误:

requireNativeComponent "RNCAndroidDropdownPicker" was not found in the UIManager
react-native native-base
5个回答
7
投票

我在全新安装节点模块后开始遇到此问题。经过一番研究,我通过安装软件包解决了这个问题。

如果您使用

yarn
进行软件包安装

yarn add @react-native-community/picker

如果你使用npm

npm install @react-native-community/picker

如果您正在使用expo

expo install @react-native-community/picker

3
投票

它对我有用:

npm install @react-native-picker/picker --save 

链接:

iOS:

cd ios && pod install 

安卓:

Clear and gradle run

1
投票

问题出在原生基础版本 2.x 上 替换这个:

import { Picker, Button, Container, Form, Item, Card, Text, Icon, Label } from 'native-base';

为此:

import { Picker } from '@react-native-picker/picker';
import { Button, Container, Form, Item, Card, Text, Icon, Label } from 'native-base';

当然需要安装:

@react-native-picker/选择器

yarn add @react-native-picker/picker


在react-native >= 0.68.x 中测试


0
投票

刚刚在全新安装时遇到了同样的问题(没有博览会),对我来说简单的修复是通常的嫌疑。

重置服务器和缓存

npx react-native start --reset-cache

删除节点模块,清理并构建。重新安装并再次运行。

rm -rf node_modules

npm i

cd android/

./gradlew clean

cd ../

npx react-native run-android


0
投票

我在使用 AWS amplify 时遇到了同样的问题。我只需安装选择器包就可以解决这个问题。

npm install @react-native-community/picker
© www.soinside.com 2019 - 2024. All rights reserved.