简体   繁体   English

手动将React Native依赖项导入现有的iOS应用

[英]Import React Native dependency to existing iOS app manually

It seems like just about every tutorial and blog post out there has you integrating RN into an existing app using CocoaPods. 似乎几乎每个教程和博客文章都使用CocoaPods将RN集成到现有应用程序中。 Adding CocoaPods support isn't a possibility for our existing iOS app - we are relying on Carthage for dependency management already which doesn't seem to be supported by RN. 对于我们现有的iOS应用程序,无法添加CocoaPods支持-我们已经依靠Carthage进行依赖项管理,而RN似乎似乎不支持它。

So, I went through the process of adding the dependencies manually by attempting to recreate the iOS app that is produced when using the RN CLI (react-native init): 因此,我尝试通过尝试重新创建使用RN CLI(反应本地init)时生成的iOS应用来手动添加依赖项的过程:

-Add the React.xcodeproj from node_modules/react-native to my Libraries folder, and also add the other Libraries from node_modules/react-native/Libraries, such as RCTActionSheet.xcodeproj. -将来自node_modules / react-native的React.xcodeproj添加到我的Libraries文件夹中,还添加来自node_modules / react-native / Libraries的其他库,例如RCTActionSheet.xcodeproj。 Then, I added all of those to the 'Link Binary With Libraries' section in Build Phases. 然后,在构建阶段的“链接二进制文件与库”部分中添加了所有这些代码。

-Updated 'Other Linker Flags' to -ObjC -Ic++. -将“其他链接器标志”更新为-ObjC -Ic ++。

...My app build is still failing with "RCTRootView.h file not found". ...我的应用程序构建仍然失败,并显示“找不到RCTRootView.h文件”。

Does anyone have experience with just adding RN manually to an existing iOS project, that might be able to provide a definitive list of steps for adding it manually to an existing project? 有没有人有将RN手动添加到现有iOS项目中的经验,也许可以提供将其手动添加到现有项目中的确切步骤列表?

除了其他步骤,我还需要更新HeaderSearchPaths设置以指向node_modules中的React文件夹: http ://i.imgur.com/jK0IMZN.jpg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在现有的 React Native App 中集成原生 ios 摄像头 SDK? - How to integrate native ios camera SDK in existing react native App? 将React Native应用程序嵌入现有的ios / android应用程序中 - Embed react native app inside existing ios/android app 运行 react native ios 应用程序时找不到文件依赖项错误 - File not found dependency error while running react native ios app 将 react-native 版本 0.62.2 集成到现有 IOs 应用程序错误 - Integrate react-native version 0.62.2 into existing IOs app error 使用react-native-navigation将React本机应用程序与现有iOS应用程序集成 - integrate react native app using react-native-navigation with existing iOS app 与现有应用程序进行本机集成反应 - React Native Integration with Existing App 为 iOS 在本机反应中创建自己的依赖项 - Create own dependency in react native for iOS 使用 xamarin 应用程序覆盖现有的 ios 本机应用程序 - Overwriting existing ios native app with xamarin app 集成在React Native上找不到的现有应用程序iOS“React / RCTEventDispatcher.h”文件 - Integrating existing app iOS 'React/RCTEventDispatcher.h' file not found on React Native 将React Native应用程序集成到现有的iOS Obj-C / Swift应用程序中 - Integrate a React Native app in to an existing iOS Obj-C/Swift App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM