You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 15:55:51