You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue where Config from react-native-config is returning an empty object {}, even though the .env file and build configurations are properly set up. I have followed the documentation and verified all steps, but the issue persists.
Steps to Reproduce:
Installed react-native-config in my React Native project.
Created a .env file in the project root with the following content:
I've similar issue I'm using react-native cli not expo. I was upgrading my app with the help of react-native-upgrade helper but whenever i switch the version from 0.73.11 to 0.74.0 the npx react-native config return "project": {"ios": null}" and it does not let me install pods saying undefined method for nil class in use_native_modules!
Description:
I am encountering an issue where
Config
fromreact-native-config
is returning an empty object{}
, even though the.env
file and build configurations are properly set up. I have followed the documentation and verified all steps, but the issue persists.Steps to Reproduce:
react-native-config
in my React Native project..env
file in the project root with the following content:android/app/build.gradle
:Config
object in JavaScript:Expected Behavior:
The
Config
object should contain the variables from the.env.sample-debug
file, e.g.:Actual Behavior:
The
Config
object is returning an empty object:Environment:
1.5.3
0.72.4
16
8.1.1
Ladybug
[email protected]
Troubleshooting Steps Taken:
.env.sample-debug
exists in the project root and has no formatting issues (e.g., no spaces around=
).dotenv.gradle
is being applied by adding a debug log:.env
file is being used.BuildConfig
in the decompiled APK. The variables from.env
were not embedded inBuildConfig
.yarn start --reset-cache
.react-native-config
..env
file (e.g.,TEST_KEY=hello-world
), butConfig.TEST_KEY
was still undefined.Additional Notes:
debug
andrelease
builds../gradlew clean
and rebuilding did not resolve the issue.BuildConfig
after decompiling the APK.The text was updated successfully, but these errors were encountered: