-
Notifications
You must be signed in to change notification settings - Fork 659
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
Release build unable to access .env file on android #770
Comments
Is it working for you in dev mode? |
xlcrr I had to upgrade my RN to 0.72.3 the latest version. |
It's working for you now @eakenbor ? |
Thanks for the reply. I am using 0.72.3 and its not working out of the box on android, will post my solution when I find it |
ensure that you add your BuildConfig to your proguard rules. Took me hours to figure out. IMHO the README needs a major makeover. This should be pretty much on top it. In your
Obviously you need to adapt the package to your actual app package name |
I had done the above, but it still didn't work. Thank you @rburgst for writing also this, which I had missed!:
With that it works properly. As stated in another issue, the readme needs an overhaul! |
Thanks for the tip but updating proguard-rules.pro did not work for me If anyone would like to help collaborate on an open source project with latest versions of everything I would really love some help here! https://github.com/OpenLitterMap/react-native Happy to post the solution when I get it |
Latest minor react-native release fixed it for me, 0.72.3 -> 0.72.4 |
No idea why this fixed it for me but I was running through an npm script that was also doing |
This did not work for me |
I have upgraded to |
Hello, I was trying to update from react-native 0.71.11 to 0.72.6 and I started to face the same issue, any news on that? |
After including the ENVFILE env var right before running react-native it worked, it seems react is trying to make some validation with build gradle before |
Thankyou! Its working after add this line pro-guard |
I have problem same. Someone help me! |
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 --mode=release
orreact-native run-android --variant=release
Here are my codes:
// ../app/build
// proguard-rules.pro
My AndroidManifest.xml does not have a package name
Please can someone help me with this?
The text was updated successfully, but these errors were encountered: