react-native-community / upgrade-support

A central community-backed place to request and give help when upgrading your app.
MIT License
251 stars 2 forks source link

Integrate React Native without Cocoapods #236

Open zhock opened 1 year ago

zhock commented 1 year ago

Environment

System: OS: macOS 13.3.1 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 557.38 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.0.0 - ~/.nvm/versions/node/v18.0.0/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.6.0 - ~/.nvm/versions/node/v18.0.0/bin/npm Watchman: 2023.04.24.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.12.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: Android NDK: 20.1.5948944 IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 14.3/14E222b - /usr/bin/xcodebuild Languages: Java: 17.0.7 - /Users/elberth.bracho/Library/Java/JavaVirtualMachines/corretto-17.0.7/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.7 => 0.71.7 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Things I’ve done to figure out my issue

-I Added all the React native dependencies as a framework in my native project. -I added the header paths in my Build Setting

When I build the app I'm getting this error:

Showing All Messages Undefined symbol: _OBJCCLASS$_RCTBridge Undefined symbol: _OBJCCLASS$_RCTEventEmitter Undefined symbol: _OBJCCLASS$_RCTRootView Undefined symbol: _OBJCMETACLASS$_RCTEventEmitter Undefined symbol: _RCTRegisterModule

Screenshot 2023-05-08 at 4 29 53 PM

Description

According to the official documentation of RN, it is possible to integrate it to an existing application without using Cocoapod by doing this procedure manually. Could you explain how this procedure works?

The project I am trying to update uses React Native version 0.60.6, in which it was possible to use a fat framework with all the RN dependencies, then that fat framework was included in the native project along with the JS bundle that was preprocessed and added separately.

The project already uses SPM as a dependency manager and our goal is to continue using the module made in React Native without adding Cocoapods.

What files should I add to my Project? What headers should I include? What configuration should I apply to my project?