1

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.1
  • react-native-config: 1.1.6
  • Using React Native CLI (not Expo)

Issue:

import Config from 'react-native-config';
    
console.log('1 ::::', Config);
console.log('2 ::::', Config.APP_NAME);

Output on Android:

1 :::: {}
2 :::: undefined

What I’ve tried:

  • .env file exists in the project root.

  • Variables are all uppercase:

    APP_NAME=MyApp APP_URL=https://example.com

  • Rebuilt the app multiple times (cd android && ./gradlew clean etc.).

  • iOS builds print the env variables correctly — this happens only on Android.

Related Issues:

I saw similar issues but none of the solutions worked:

1
  • I use react-native-ultimate-config for this and it works perfectly! Commented 2 days ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.