2

I'm using react-native-config npm for environment property. I can able to access the environment property in JS file. I am unable to access it in androidManifest.xml. I followed through the instruction.

.env

SCHEME = http
HOST = app.com

buildgradlew

defaultConfig {
resValue "string", "build_config_package", "com.geo.vendor"
}

AndroidManifest.xml

<data android:scheme="SCHEME"
              android:host="HOST"/>
2
  • Did you add "project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" to the android/app/build.gradle as well? as per github.com/luggit/react-native-config Commented Sep 24, 2021 at 8:03
  • Yes, I added all the step from the docs Commented Sep 24, 2021 at 9:12

1 Answer 1

1

According to their docs, the "build_config_package" setting is only for the Android package name / applicationId, not for other values such as the one you are trying to set.

Try it like this:

.env

SCHEME=http
HOST=app.com

AndroidManifest.xml

<data android:scheme="@string/SCHEME"
          android:host="@string/HOST"/>
Sign up to request clarification or add additional context in comments.

Comments

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.