Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load env using react native config while release #777

Open
avinash-marsdevs opened this issue Apr 29, 2024 · 3 comments
Open

Unable to load env using react native config while release #777

avinash-marsdevs opened this issue Apr 29, 2024 · 3 comments

Comments

@avinash-marsdevs
Copy link

avinash-marsdevs commented Apr 29, 2024

Describe the bug

When running yarn android:release in a React Native project, the environment configurations do not load. However, the configurations load as expected when running yarn start. This issue occurs in a setup with a self-hosted domain URL of Chatwoot and a modified namespace.

To Reproduce

Steps to reproduce the behavior:

  • Set up a self-hosted Chatwoot environment with a custom domain URL and modified namespace.
  • Configure React Native project to use environment-specific settings.
  • Run yarn start to confirm that the environment settings load correctly.
  • Run yarn android:release and observe that the environment settings are not loaded.

Expected behavior
The environment configurations should load consistently across both development (yarn start) and production builds (yarn android:release).

Observed behavior

The configurations that load correctly during yarn start are not loaded when executing yarn android:release. This results in default or empty configuration values being used, impacting the functionality depending on these configurations.

Environment

Chatwoot Installation: Self-hosted

Additional context

The issue seems related to the way environment variables are managed and loaded in the release build process. The react-native-config library is used for managing environment variables and might be misconfigured for production builds.

Attached changes diff

Copy link

linear bot commented Apr 29, 2024

@avinash-marsdevs
Copy link
Author

lugg/react-native-config#770

Might be a problem with react-native-config itself I guess

@avinash-marsdevs
Copy link
Author

def enableProguardInReleaseBuilds = false
minifyEnabled enableProguardInReleaseBuilds

this change did the magic. but if I need to enable proguard, I wonder what will be the resolution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant