[英]'File not found' when integrating React Native with existing project
[英]Integrate react native into existing Swift project: 'string' file not found
我根据此教程尝试将React Native集成到我现有的iOS应用程序(混合代码ObjC和Swift)中: https ://facebook.github.io/react-native/docs/integration-with-existing-apps.html
但是,每当我尝试编译我的项目时,我都'string' file not found
(还有一个问题: https : //github.com/facebook/react-native/issues/17556但还没有解决方案)。
有人解决了这个问题吗?
我们最近在通过CocoaPods集成RN时也遇到了这一问题。
不知道您是否仍在寻找解决方案,但是正如esam091在所链接的问题中所述,一种解决方法是在Podfile中添加此后安装挂钩。
# Podfile
def remove_unused_yoga_headers
filepath = './Pods/Target Support Files/yoga/yoga-umbrella.h'
contents = []
file = File.open(filepath, 'r')
file.each_line do | line |
contents << line
end
file.close
contents.delete_at(14) # #import "YGNode.h"
contents.delete_at(14) # #import "YGNodePrint.h"
contents.delete_at(14) # #import "Yoga-internal.h"
file = File.open(filepath, 'w') do |f|
f.puts(contents)
end
end
post_install do | installer |
remove_unused_yoga_headers
end
这将删除罪魁祸首。 从RN 0.53开始仍然是一个问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.