weixin_39942335
weixin_39942335
2021-01-12 07:06

svgRef.toDataURL() crash on Android

toDataURL is working on iOS but crashing on Android.

RN version : 0.47.0 react-native-svg version : 5.4.1 react version : 16.0.0-alpha.12

Code : test(svgRef) { if (svgRef) { svgRef.toDataURL(base64 => { }) }}

<Svg width={this.props.width} height={this.props.height} ref={ref => { if (this.state.released) { this.test(ref); } }} > ... </Svg>

Error : undefined is not an object (evaluating RNSVGSvgViewMAnager.toDataURL)

该提问来源于开源项目:react-native-community/react-native-svg

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39611546 weixin_39611546 4月前

    Any news here? I use Expo and got this crash.

    点赞 评论 复制链接分享
  • weixin_39562606 weixin_39562606 4月前

    At least seems to work with the latest code, I think Expo still hasn't upgraded, probably worth asking in their repo.

    点赞 评论 复制链接分享
  • weixin_39600510 weixin_39600510 4月前

    Hi, some news about this? I'm facing the same problem... Just on Android... on iOS it's Ok... I tried update to
    "expo": "^30.0.0" "react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz" But the problem continues...

    点赞 评论 复制链接分享
  • weixin_39562606 weixin_39562606 4月前

    Seems to work fine, please provide a full replication. Closing until then.

    点赞 评论 复制链接分享
  • weixin_39631301 weixin_39631301 4月前

    was this fixed since?

    点赞 评论 复制链接分享
  • weixin_39562606 weixin_39562606 4月前

    I don't remember testing recently, will have to check.

    点赞 评论 复制链接分享

相关推荐