无法构建应用程序,我收到导入文件未找到错误与不同的包
所以我尝试了导入“{任何文件名}. h”
但我一再面临react-native-line-渐变,快速图像,webview等错误
❌ node_modules/react-native-fast-image/ios/FastImage/FFFastImageViewManager. h:1:9:'React/RCTViewManager.h'文件未找到
❌ node_modules/react-native-fast-image/ios/FastImage/RCTConvertFFFastImage. h:1:9:'React/RCTConversion.h'文件未找到
^~~~~~~~~~~~~~~~~~~~
React/RCTViewManager. h'文件未找到(这是由于线性渐变)包)
我个人在Podeile
中添加了一点代码来解决标题搜索路径问题,因为你在这里遇到了它
post_install do |installer|
puts 'post_install'
app_project = Xcodeproj::Project.open("./X.xcodeproj")
output = `find .. -name "*.xcodeproj"`
p output
output.split("\n").each do |projectPath|
app_project = Xcodeproj::Project.open(projectPath)
app_project.native_targets.each do |target|
target.build_configurations.each do |config|
if !config.build_settings['HEADER_SEARCH_PATHS']
config.build_settings['HEADER_SEARCH_PATHS'] ||= []
end
config.build_settings['HEADER_SEARCH_PATHS'] << ' $(SRCROOT)/Pods/Headers/**'
config.build_settings['HEADER_SEARCH_PATHS'] <<' $(SRCROOT)/../../../../ios/Pods/Headers/**'
config.build_settings['HEADER_SEARCH_PATHS'] << ' $(SRCROOT)/../../../ios/Pods/Headers/**'
config.build_settings['HEADER_SEARCH_PATHS'] << ' $(SRCROOT)/../../ios/Pods/Headers/**'
config.build_settings['HEADER_SEARCH_PATHS'] << ' $(SRCROOT)/../ios/Pods/Headers/**'
app_project.save
end
end
end
puts 'post_install DONE'
end
我希望我能帮上忙