React Native iOS Swift Error: Could not build Objective-C module 'React'

Viewed 282

Following the steps in the link doesn't help in integrating react native in existing project.

Link: https://reactnative.dev/docs/integration-with-existing-apps

Configuration

Mac OS X - 10.15.6 (19G2021)
XCode - 12.1 (12A7403)
React Native Cli - 2.0.1
React Native - 0.63.4

package.json

{
  "name": "MyReactNativeApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "yarn react-native start"
  }
  "dependencies": {
    "react-native": "^0.63.4"
  }
}

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

When I run pod install. I gives a warning.

[!] 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$ 

When I need to import React, it gives 2 error

Could not build Objective-C module 'React' - where I import React
'Layout.h' file not found - in RCTConvert.h

Screenshot:

enter image description here

enter image description here

I did change 'Allow non-modular includes in Framework Module' to YES but it didn't work.

I have observed whatever documentation is mentioned doesn't work smooth & has lots of issues.

0 Answers
Related