react-native IOS模拟器上 was not found in the UIManager

问题描述

在工程中引入 react-native-spinkit
然后执行 react-native link
使用xcode直接运行可以
但在终端运行 react-native run-ios 还是不行
报错:
Invarint Violation:requireNativeComponent: “RNSpinkit” was not found in the UIManager

RN版本 0.57.3

检查xcode Header Search Paths 中 Debug和Release都link成功

相关代码

const Spinner = require('react-native-spinkit');
<Spinner size={25} color="#FFF" type="Circle"/>

请问有什么方案可以解决此问题吗

阅读 6.4k
3 个回答
import {
    NativeModules,
} from 'react-native';
const {UIManager}=NativeModules;
UIManager.setLayoutAnimationEnabledExperimental &&
    UIManager.setLayoutAnimationEnabledExperimental(true);

引入的位置加入这几行代码试试

新手上路,请多包涵

也遇到同样问题 请问最后解决了么 楼上方案好像不生效。

expo项目eject后装第三方也是这个问题,好像也没解决

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题