skip to Main Content

When running Archive in XCode 14.2 of react native code we run into this error in AppDelegate file.

No matching function for call to ‘RCTAppSetupPrepareApp’

I am using react native 0.71.7, react-native-cli: 2.0.1, and node 18.13.0

The code was supposed to be archived, but doesnt.

3

Answers


  1. I was facing same error so I checked the actual version of react and previous I had when it worked last time. According to react-native upgrade helper, I see that this piece of code has changed and is no longer there. Check if this is not the case for you too.

    https://react-native-community.github.io/upgrade-helper/?from=0.70.6&to=0.71.2

    Login or Signup to reply.
  2. I’ve fixed the issue with the following changes:

    File: AppDelegate.mm

    Before:

    RCTAppSetupPrepareApp(application);
    

    After:

    RCTAppSetupPrepareApp(application, true);
    

    Before:

    UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"Mobile", initProps);
    

    After:

    UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"Onboarding", initProps, true);
    

    Thanks to dimitardanailov who answered in here

    Login or Signup to reply.
  3. change RCTAppSetupPrepareApp(application);

    TO

    RCTAppSetupPrepareApp(application,true);

    And

    *change UIView rootView = RCTAppSetupDefaultRootView(bridge, @"attendance", initProps)

    TO

    *UIView rootView = RCTAppSetupDefaultRootView(bridge, @"attendance", initProps,true);

    And

    you might be need to clean the project after follow these steps

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