Android端react-native-gifted-charts报错:RNSVGSvgViewAndroid未找到
Android端react-native-gifted-charts崩溃:找不到RNSVGSvgViewAndroid组件
使用react-native-gifted-charts(参考版本1.0.3),图表在iOS端运行正常,但Android端持续崩溃,抛出错误:Invariant Violation: requireNativeComponent: "RNSVGSvgViewAndroid" was not found in the UIManager。起初怀疑是代码问题,但回滚代码后错误仍存在。
使用yarn作为包管理器,采用Expo托管工作流,当前依赖版本:
- "react-native": "0.70.5"
- "react-native-gifted-charts": "^1.2.42"
- "react-native-linear-gradient": "2.6.2"
- "react-native-svg": "12.1.0"
已尝试的解决方法
- 删除node_modules后重新执行
yarn install→无效 - 调整react-native-svg版本→无效
- 移除react-native-gifted-charts、react-native-linear-gradient、react-native-svg后重新安装→无效
- 编写极简BarChart示例测试(代码如下)→无效
- 执行
yarn cache clean清理缓存→无效
测试代码
import React from "react"; import { BarChart } from "react-native-gifted-charts"; export const StatisticsScreen = () => { const data=[ {value:50}, {value:80}, {value:90}, {value:70} ] return ( <BarChart data={data} /> ); };
内容的提问来源于stack exchange,提问作者peruvian66
相关产品推荐
相关产品推荐

