经过几天在互联网上的研究,我仍然没有解决我的问题。 我正在使用 react-native-svg 并且遇到了同样的问题: No component found for view with the name "RNSVGPath"
或者这个: Invariant Violation: Native component for "RNSVGSvgView" does not exist
我尝试了很多东西,包括:
react-native unlink react-native-svg
npm uninstall react-native-svg
npm install react-native-svg
react-native link react-native-svg
react-native run-ios
还有:
pod 'RNSVG', :path => '../node_modules/react-native-svg'
rm -rf node_modules
npm install
react-native run-ios
但是还是没有... 这是我使用的版本:
"dependencies": {
"react": "16.1.1",
"react-native": "0.50.3",
"react-native-svg": "^6.0.1-rc.1"
}
我尝试直接从 XCode 构建它,但仍然没有...
谢谢你们的帮助!
最佳答案
你应该尝试这样做:
npm install react-native-svg --save //(again)
react-native link react-native-svg //(again)
watchman watch-del-all
rm -rf node_modules/ && yarn cache clean && yarn install
然后在另一个终端
npm start -- --reset-cache
在使用 react-native run-ios 启动 ios 应用程序之前,您必须手动将 libRNSVG.a 添加到 Xcode 中的链接框架和库
然后……多田
关于ios - 不变违规 : Native component for "RNSVGSvgView" does not exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47672941/