50 questions
1
vote
0
answers
24
views
react-native-config returns empty object on Android (RN 0.80.1, react-native-config 1.1.6)
I am new to React Native. I’m using react-native-config in a React Native CLI project (not Expo), and it works correctly on iOS but returns an empty object on Android.
Environment:
react-native: 0.80....
0
votes
0
answers
19
views
react-native-config iOS - `Config` is empty if no `.env` in project root despite extra steps is done (RNC 1.5.9)
My RN app have two targets - production and staging, each of them have release and debug configurations. When I have .env file in project root where .env.production and .env.staging are stored, my App ...
0
votes
0
answers
47
views
react-native-config: empty `Config` object in one of android build flavors used with --appIdSuffix (RN 0.75.5)
I've created two build flavors to have two builds of my react native application. While I run production flavor in debug mode, Config object is populated with correct values, while Config object is ...
0
votes
1
answer
409
views
React Native iOS build fails: No such module 'RNCConfig' in Swift AppDelegate.swift
I'm upgrading my React Native project from version 0.73.6 to 0.77.2. After completing the upgrade, my iOS build fails with the following error in AppDelegate.swift:
No such module 'RNCConfig'
...
0
votes
3
answers
4k
views
react-native-config not working on android - RNCConfig Module tried to override RNCConfigModule
I followed the instructions on the react-native-config package but Im getting the following error:
Native module RNCConfig Module tried to override RNCConfigModule. Check the getPackages() method in ...
0
votes
1
answer
351
views
Error after adding react-native config: Cannot use import statement outside a module
While developing a React-native app I was using process.env to check whether my app was in production or development in my app.config.ts :
import { ExpoConfig, ConfigContext } from 'expo/config';
...
-1
votes
1
answer
725
views
React Native Config error while creating Archive Build in IOS Xcode
I have a react native named MyApp and it is two app sides managed in single codebase.The app is managed by react native config during its build the config is set to that specific environment like env1 ...
-1
votes
1
answer
677
views
High severity vulnerabilities intalling react-native-config
When I try to install react-native-config in my react native project on ios I always get the same output:
141 packages are looking for funding
run `npm fund` for details
5 high severity ...
0
votes
2
answers
518
views
AWS S3 Access and Secret Key management in React Native
I want to store my aws s3 access key and secret key in my react native app. I am storing it in env file and using it via react-native-config. But i received a mail from play console saying the key is ...
0
votes
4
answers
1k
views
react-native-config package Multiple Environments
I am developing app with "react-native" and "react-native-config package".
I have installed "react-native-config" according to the manual. (https://www.npmjs.com/package/...
4
votes
2
answers
6k
views
React Native: .env file values aren't being read with react-native-config
I'm rebuilding my Expo app in pure React Native and trying to figure out the environment variable situation. I'm trying out react-native-config, currently on "^1.5.1". I installed using yarn ...
1
vote
0
answers
92
views
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 ...
2
votes
0
answers
212
views
React Native & AWS Client STS
I am trying to get cross account credentials for AWS Client Secret Manager by calling main function in the file.
I am getting an error saying Error: Credentials Missing
I tried everything, except for ...
1
vote
4
answers
3k
views
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"
...
1
vote
0
answers
513
views
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 ...
-1
votes
2
answers
2k
views
React-native [Axios Error: Network Error]
I want to fetch API from my 'https://localhost:7262/api' address, but that is giving
Network Error. I want to do GET request and then i am going to do POST request. Also my API server is always open ...
2
votes
2
answers
8k
views
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 ...
1
vote
0
answers
801
views
React Native Config Not Picking Up .env Changes
My react-native-config isn't picking up changes in my .env
Only when I uninstall and then reinstall does react-native-config pick up the changes in my .env file.
1
vote
1
answer
334
views
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 ...
0
votes
1
answer
2k
views
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: "....
0
votes
0
answers
834
views
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 ...
1
vote
1
answer
3k
views
react native staging in android
I am trying to get flavors or build variants running in android for my react-native project.
Via Schemes I got the same running on iOS, but Android does not want to follow. I guess something I am ...
0
votes
1
answer
2k
views
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 &...
2
votes
0
answers
2k
views
How to use the fastlane action `environment_variable `
According to the document of action environment_variable.
I've tried to use it this way in my Fastfile but failed.
environment_variable(set: { ENVFILE: ".env.dev" }) # failed
I can not ...
0
votes
1
answer
238
views
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 ...
0
votes
1
answer
788
views
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/')
...
1
vote
2
answers
1k
views
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 ...
1
vote
1
answer
580
views
[Android][react-native-config] Getting correct .env with productFlavors
I did as the document with .env file picker like this
project.ext.envConfigFiles = [
debug : ".env",
release : ".env.production",
adhoc ...
2
votes
0
answers
410
views
react-native-config use env inside .json file located at android folder
Documentation contains example for android native usage only for .xml and java classes. I'm having file 'msal_config.json' located at android/app/src/main/assets folder. Is there any way for me to ...
0
votes
1
answer
1k
views
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-...
1
vote
1
answer
376
views
react native config: Activity class dose not exists
I set a file .env.devdps
APP_NAME=TestDps
just use APP_NAME in AndroidManifest.xml
<activity
...
android:label="@string/APP_NAME"
/>
In my android/app/build.gradle
defaultConfig {...
0
votes
0
answers
3k
views
react-native-config: cannot find symbol
I've got a fresh React Native app, where I'm trying to use react-native-config:
npx react-native init RNConfigDemo
cd RNConfigDemo
yarn add react-native-config
echo "SOME_VAR="something&...
0
votes
1
answer
2k
views
How to use react-native-config with a react native app build with Swift
I am trying to use the react-native-config with react-native configured with Swift.
Following the usage guide, it tells me to import #import "ReactNativeConfig.h".
I imported this inside of ...
18
votes
6
answers
36k
views
PhaseScriptExecution failed for react-native-config on Xcode build
I am trying to build my React Native project on Xcode and it is failing. The build target is react-native-config with the error: Run custom shell script '[CP-User] Config codegen' "Command ...
1
vote
0
answers
213
views
What is the best way to handle the use of staging or production API root url in a React Native app?
Say I have a staging API url and a production API url. What is the best way to setup the app to use the production API url when I want to release a build to the stores and the staging API url when I ...
4
votes
0
answers
972
views
How to define variants in Android Studio for development and release application for React Native application
I use react-native-config for changing between production and development environments.
I can switch environments dev/prod (bundler identifier, appIcon, splashScreeen, appName, ..) base on the scheme ...
1
vote
0
answers
142
views
react native packages install for Android
I've been using React Native for a little while now and I've always struggled with some of the gradle stuff for the Android side of things. Since 0.60.0 the iOS side has been great with using the pod ...
2
votes
1
answer
12k
views
react native config cannot read env file in ios
I have follow the doc: https://github.com/luggit/react-native-config#ios
until: Availability in Build settings and Info.plist
step 6. create new build phase for the scheme which will generate "...
3
votes
2
answers
5k
views
Pass env file to detox
I would like to pass environment variable when I run detox tests in my react-native app:
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/myapp.app",
"build":...
18
votes
3
answers
4k
views
Use .env variables to set up appcenter on a react-native app
I started using MS appcenter in my bare react-native app, and during the set up they ask me to add two new files to the project:
For IOS: AppCenter-Config.plist with
<dict>
<key>...
0
votes
1
answer
2k
views
How to fix JSON value '<null>' of type NSNull cannot be converted to NSString in iOS react-native-config and AsyncStorage?
I'm having problems with react native config and AsyncStorage, where null data from .env is not readable on iOS,
below is my code:
_authAsync = async () => {
const userToken = await ...
0
votes
1
answer
1k
views
How to manage react-native .env variables with PhpStorm Run/Debug Configuration?
I am using PhpStorm and trying to automate the run with specific env variable. Managing .env variables for dev, staging, prod is very time saving and safe. So when I run set ENVFILE=.env.staging &&...
0
votes
1
answer
884
views
React native Config - Setting .env
I am using react-native-config for setting environment variable in my react native project. I have a local image url in my .env config file. I am able to get the local image url in my component using ...
0
votes
1
answer
1k
views
react-native-config change .env file path from root to other folder
I use from react-native-config in my project and my .env file exist in a sub folder rather than root path.
In build.gradle file i have:
project.env.get("APP_VERSION_CODE").toInteger()
but when i run ...
1
vote
2
answers
4k
views
Using react-native-config with fastlane
currently in my react-native app I configure two lanes using fastlane: beta and production. I'm using react-native-config for different environment configs (stored in 2 files: .env.beta and .env....
1
vote
0
answers
349
views
Per-environment config in create-react-native-app
I have an app that I created using create-react-native-app. I'm trying to use react-native-config to manage config variables that differ between dev and production.
This requires the following steps, ...
0
votes
1
answer
1k
views
Upgrade ReactNative to 0.55.4 and android build compile with error
The build is failing after updating project to RN ^0.55.4
Seems like the problem is relating with the react-native-config dependency Android BuildVersion 23.0.1
The android bin is deprecated and we'...
0
votes
3
answers
6k
views
react-native-config unable to use env variables in build.gradle
I have react-native-config set up and use it in javascript no problem but am unable to use it like this in build.gradle.
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
...
1
vote
2
answers
2k
views
Views looks different in react native for android and ios
I am creating an app on react-native but views look different in both android and ios.
Views are fine on android but on ios they look different. Can you look into sample component and let me know ...
0
votes
2
answers
430
views
Using react-native-config with babelRelayPlugin with remote graphql schema
My react native code was working fine till yesterday, but today while I was trying to compile the code I am getting this strange error.
node /Users/aragorn/relay-react-native-app/node_modules/react-...