react-native-config: Config is empty after upgrade to RN 0.71

react-native: 0.71.13 react-native-config: 1.5.1

After upgrading react-native from 0.70.9 to 0.71.13, the config is empty.

This is what I get when I log config:

import Config from "react-native-config";
console.log(Config);

Output: {"dependencies": {}}

I have tried downgrading to version 1.4 and 1.3, but that does not help.

I have set this in the pre-actions without success:

cp "${PROJECT_DIR}/../.env.staging" "${PROJECT_DIR}/../.env"
echo “.env.staging” > /tmp/envfile
touch "${PROJECT_DIR}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.rb"

Note that it worked fine on RN 0.70.9. Any help would be appreciated.

Update: I am having the exact same issue on Android

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 4
  • Comments: 24

Most upvoted comments

I having the same in my app. Xcode Version: 15 react-native: 0.72.5

I upgrade to RN 0.71.13 and then upgraded react-native-config from 1.4.6 to 1.5.1 at this point iOS Config became empty.

Downgrade react-native-config back to 1.4.6 and it started working again, Config was being returned as expected.

Facing the same issue with RN 0.72.5. Though the console.log(Config) results in {}`.

Has anyone got this library working on RN 0.71 or 0.72?

@vanenshi When I tried this the last time I was on OS 13 and xcode 14. I have now upgraded my OS and xcode, but I have not checked if that changes anything.