Fixing “”Use of undeclared identifier ‘ReactNativeConfig” error

Serdar Cevher
Oct 11, 2023

It seemed easy, but it wasn’t obvious how to fix this error. It was about a renamed config file though.

If you ever encountered this error, or “ReactNativeConfig/ReactNativeConfig.h’ file not found error after trying to import it in your AppDelegate.m file, all you need to do it a renaming operation.

  1. Use `#import “RNCConfig.h”` instead of the old import statement (#import ReactNativeConfig/ReactNativeConfig.h)
  2. When you attempt to read the env variable, use `RNCConfig envFor` instead of `ReactNativeConfig envFor`.
    Example: `NSString *mapsApiKey = [RNCConfig envFor:@”GOOGLE_MAPS_API_KEY”];`

That’s all.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Serdar Cevher
Serdar Cevher

Written by Serdar Cevher

Developer of web & mobile apps | Co-founder: Off2Class, Auglinn | Founder: SmarDish, tarifmotoru.com, valizim.com | Ex columnist @PCnetDergisi

Responses (2)

Write a response