Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS build fails after upgrading to react-native 0.77.1 #830

Open
ingvardm opened this issue Feb 17, 2025 · 7 comments
Open

IOS build fails after upgrading to react-native 0.77.1 #830

ingvardm opened this issue Feb 17, 2025 · 7 comments

Comments

@ingvardm
Copy link

After upgrading to rn 0.77.1 and porting AppDelegate.mm to swift i get an error during ios build "No such module RNCConfig". With rn 0.76.6 everything was working as expected.
Any help is much appreciated.

@SMJ93
Copy link

SMJ93 commented Feb 20, 2025

@ingvardm add the following to your briding-header-h file so you can access RNCConfig inside your swift files:

#import "RNCConfig.h"

Then inside your AppDelegate.swift access with the following:

let configName = RNCConfig.env(for: "config_name")

@ingvardm
Copy link
Author

@SMJ93 Thank for the reply. Already tryed that, still fails to build with the same error.

@budiadiono
Copy link

@ingvardm I have same problem, I found that to add the bridging header we have to use xcode to do that. Like so:

Open [yourapp].xcworkspace using xcode, then:

  1. Select your project
  2. Go to Build Settings
  3. Search for "bridging header"
  4. Set "Objective-C Bridging Header" to: $(SRCROOT)/YourApp-Bridging-Header.h

@ingvardm
Copy link
Author

@budiadiono Already tried that, see previous comments.

@Mando7818
Copy link

Bump

@dylanhillier
Copy link

dylanhillier commented Mar 19, 2025

@ingvardm add the following to your briding-header-h file so you can access RNCConfig inside your swift files:

#import "RNCConfig.h"

Then inside your AppDelegate.swift access with the following:

let configName = RNCConfig.env(for: "config_name")

This is the correct approach.

Adding the imported RNCConfig.h to the bridging header will then make the RNCConfig module available in the AppDelegate.swift file.

Things potentially to note:

  1. It is RNCConfig, not RNConfig.
  2. Previously you may have referred to it as ReactNativeConfig, which is no longer correct.
  3. If you haven't done so already, you probably need to run something like bundle exec pod install --repo-update in your ios directory.

@hamdij0maa
Copy link

  • 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants