React-native 链接在手动删除链接后不会重新链接

React-native link does not relink after manually removing the links

提问人:Peter G. 提问时间:3/4/2020 最后编辑:Peter G. 更新时间:3/4/2020 访问量:255

问:

该命令在我第一次安装依赖项时正常工作。react-native linknpm

在调试期间,我手动删除了 iOS 项目中 Libraries 和 Frameworks 文件夹的内容,从那时起,该命令无法再次链接它们。react-native link

“我的库”和“框架”文件夹为空:

Libraries and frameworks not linked

我的也是空的,只有一些从 Pods 导入的。具体和阶段。Project Settings > Target > Build PhasesLink Binary With LibrariesEmbed Frameworks

但是,该命令返回成功:react-native link

$ react-native link
warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - rn-fetch-blob: https://github.com/joltup/rn-fetch-blob#readme
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
info Linking assets to ios project
info Linking assets to android project
success Assets have been successfully linked to your project

似乎是一个缓存问题,但不确定在哪里清理其缓存。

xcode npm react-native-linking ios-library

评论

0赞 Petr Bela 3/5/2020
您使用的是哪个 React Native 版本?
0赞 Peter G. 3/5/2020
@PetrBela 0.61.5
0赞 Petr Bela 3/5/2020
是的,与另一个问题类似,在 RN 0.60+ 中,链接不再更新 xcodeproj,而是添加到 Podfile(并且,由于现在许多库使用自动链接,因此不再需要)。react-native link

答: 暂无答案