How to stop react-native link from linking a library with CocoaPods with it has a podspec?

无人久伴 提交于 2019-12-03 02:26:58

The solution that I use is really a workaround. It is not great but it works for me. Ideally it would be nice if react-native link offered a -noPods flag but it doesn't.

react-native link checks to see if there is a Podfile, if there is no Podfile it links the dependency as normal.

So what I do is the following:

  1. Make sure I have committed all the changes to git.
  2. I then install the dependency using yarn or npm.
  3. I delete the Podfile.
  4. I run react-native link dependency_name
  5. I then discard the changes to the Podfile (effectively undeleting it)

Alternatively you rename the Podfile to something else, and then rename it back after you have linked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!