Questions tagged [react-native-config]
42 questions
0
votes
0 answers
React Native release build unable to access .env file on android
Everything works fine on debug but on release build, no variable in my .env files is accessible. They all appear as undefined.
"react-native": "0.71.7",
"react-native-config": "^1.5.0",
I build using the following: react-native run-android…

Efosa
- 137
- 4
- 14
0
votes
0 answers
Conditionally change envivornment variable after app is build in react native
I have configured react-native-config in my app, made two envs file i.e env.dev & env.prod. Now everything is working as per configuration.
But now I want to change env to dev or prod depending on the file downloaded from AWS S3 service( some third…

jksq
- 25
- 4
0
votes
0 answers
React Native Environmental Variables in VS App Center
I am struggling with getting .env variables to show up in my React Native app, when compiling with VS App Center. I am using react-native-config, and have a local .env file that work when developing locally, but when I build with VS App Center, the…

gregavola
- 2,519
- 5
- 30
- 47
0
votes
0 answers
"'RCTAppDelegate.h' not found" after running "Clean Build Folder" in XCode
I added an iOS target for stage build for my react-native project using XCode and updated the pre build script
cp "${PROJECT_DIR}/../.env.staging" "${PROJECT_DIR}/../.env"
to use multiple environments. It works fine and the project builds, however…

Ahmad Naeem
- 76
- 7
0
votes
2 answers
react-native-config lib returns empty Config object
I am having trouble using react-native-config in my React Native app. Here's my code:
app.js
import Config from 'react-native-config';
console.log(Config);
.env
SECRET_KEY="kndlknv94ii4rpp"
The console.log statement in app.js returns an empty…

user21604832
- 1
- 1
0
votes
0 answers
React Native: I have to clean build folder in XCode in order to get the values from my .env using react-native-config
Why do I have to clean my build folder in XCode to see the new env values in my app?
If I run an env script and then a different env script it will show the values of the previous env file. e.g if i run dev env script it will show dev env values…

jrs
- 135
- 1
- 16
0
votes
0 answers
react-native-config not working (Empty Config in both OS)
I'm really struggling with what seems like a very primitive error. I have installed react-native-config and when console.logging the Config object it returns {}.
The problem occurs both on android and iOS and it doesn't seem to be a linking issue…

Liam Clark Gutiérrez
- 117
- 1
- 12
0
votes
1 answer
react-native-config - Unrecognized option alwaysOutOfDate
I get this error when I run pod install:
The `react-native-config` pod failed to validate due to 1 error:
- ERROR | script_phases: Unrecognized option(s) `alwaysOutOfDate` in script phase `Config codegen`.
Available options are `name, script,…

QuentinNpApnl
- 41
- 5
0
votes
1 answer
React Native - Issue with ENV configurations in Android
I have configured ENVs using react-native-config package. I have 3 different ENVs which I have defined in app/build.gradle
This is defined as below -
project.ext.envConfigFiles = [
debug: ".env.dev",
stagingRelease: ".env.staging",
…

Anuj Raghuvanshi
- 664
- 1
- 7
- 24
0
votes
0 answers
After decompile the apk BuildConfig.java file values are accessible
I have created .env file in react native and from native side i'm able access the BuildConfig.KEY_NAME in MainApplication.java file
But security team hS decompiled the app/APK using MobSF and can able to access the all keys from the BuildConfig.Java…

Mallikarjun Hampannavar
- 305
- 7
- 23
0
votes
1 answer
Values of ".env" variables are not displayed with "react-native-config"
I have created a .env file and installed the "react-native-config " package, but the variable values are not displayed (on ios).
Could you help me with this?
Thanks
terminal :
LOG Running "myRecipes" with {"rootTag":51,"initialProps":{}}
LOG ALL…

phbord
- 1
- 3
0
votes
1 answer
App name showing as __RN_CONFIG_DISPLAY_NAME on iOS
I'm using react-native-config in my ReactNative app. After upgrading react-native-config to 1.4.5 and React Native to 0.66.1, everything worked well, but app name in iOS showing as __RN_CONFIG_DISPLAY_NAME.
Does anyone else have this problem?

Mohsen Zia
- 442
- 4
- 16
0
votes
1 answer
Empty config object in JS
Using RN 64.0 and fastlane, I have the following build command
desc 'Build the Staging Android application.'
lane :build_staging do
gradle(task: 'clean', project_dir: 'android/')
gradle(task: 'assemble', flavor: "staging",…

Tzvetlin Velev
- 1,897
- 2
- 17
- 31
0
votes
1 answer
How to set different env file with different bundle identifier?
I use react-native-config with XCode setting.
I want to have three version are
myapp
Prod
myapp.Dev
Dev
myapp.Qa
Qa
Here is my step:
Adding new configurations Dev and Qa with XCode
Adding new schemes for Dev and Qa with XCode
set User-Defined…

Morton
- 5,380
- 18
- 63
- 118
0
votes
1 answer
React native custom buildType not using metro
I need to build the same app to different applicationIds so that I can publish it on the Play Store / App Store as private applications for some of the customers of my company.
I decided to use react-native-config, as it should allow me to change…

balsick
- 1,099
- 1
- 10
- 23