skip to Main Content

I am trying to install react native in my existing ios application since I need to migrate the exsiting application to react native.

I have followed all the steps but getting code

First I have created a simple iOS project then Created a dir in which i created package.json

   {
  "name": "MyReactNativeApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "yarn react-native start"
  }
}
  1. installed Yarn
  2. yarn add react-native – added yarn
  3. yarn add @babel/preset-env && yarn add @babel/core && yarn add [email protected]

I have followed all steps mentioned in react native site

enter image description heregen error.

Refered sites for implemtation -> https://archive.reactnative.dev/docs/integration-with-existing-apps
https://nishabe.medium.com/how-to-integrate-react-native-code-with-an-existing-ios-app-655c61a65b8c
https://fek.io/blog/how-to-add-react-native-to-an-existing-i-os-app-in-2022/

Still getting this error
My xcode version is 15.3

2

Answers


  1. I am facing the same issue and still unable to get any solution. I’ve tried

    • removing and re-installing pod
    • changing the minimum deployment version to 13.0

    but the issue still exists.

    Login or Signup to reply.
  2. we faced same error message, and we find out that

    echo $REACT_NATIVE_PATH  
    

    outputs into empty string.
    You may check React-Fabric in PODS (via XCode) and you can see Build Phase named [CP-User] [RN]Check rncore where IF condition is blocking you:

    if [[ ! -d "$rncorePath" ]]; then
      echo 'error: Codegen did not run properly in your project. Please reinstall cocoapods with `bundle exec pod install`.'
      exit 1
    fi
    

    Then we ran:

    export REACT_NATIVE_PATH=<absolut_path_to_proj>/node_modules/react-native
    

    And everything starts to run 🙂

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search