Cha*_*har 6 ios swift react-native
遵循链接中的步骤无助于将 React Native 集成到现有项目中。
链接: https: //reactnative.dev/docs/integration-with-existing-apps
配置
Mac OS X - 10.15.6 (19G2021)
XCode - 12.1 (12A7403)
React Native Cli - 2.0.1
React Native - 0.63.4
Run Code Online (Sandbox Code Playgroud)
包.json
{
"name": "MyReactNativeApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "yarn react-native start"
}
"dependencies": {
"react-native": "^0.63.4"
}
}
Run Code Online (Sandbox Code Playgroud)
Podfile
source 'https://github.com/CocoaPods/Specs.git'
# Required for Swift apps
platform :ios, '11.0'
use_frameworks!
# The target name is most likely the name of your project.
target 'MyReactNativeApp' do
# Your 'node_modules' directory is probably in the root of your project,
# but if not, adjust the `:path` accordingly
pod 'React'
end
Run Code Online (Sandbox Code Playgroud)
当我运行 pod install 时。我发出警告。
[!] React has been deprecated
ChatarVer:MyReactNativeApp chatar.veer$ pod install
Analyzing dependencies
Downloading dependencies
Installing React (0.11.0)
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
[!] React has been deprecated
ChatarVer:MyReactNativeApp chatar.veer$
Run Code Online (Sandbox Code Playgroud)
当我需要导入React时,它给出了2个错误
Could not build Objective-C module 'React' - where I import React
'Layout.h' file not found - in RCTConvert.h
Run Code Online (Sandbox Code Playgroud)
截屏:
我确实将“允许框架模块中的非模块化包含”更改为“是”,但它不起作用。
我发现所提到的任何文档都不能顺利运行并且存在很多问题。