#2 – Expo apk keeps on crashing after build

In Production build, this is how you should initialize your environment variables. Regular .env file would not work in production

Client Development build specific:

When using Expo, the EXPO_PUBLIC_ prefix is required to make environment variables av…


This content originally appeared on DEV Community and was authored by amanbhoria

In Production build, this is how you should initialize your environment variables. Regular .env file would not work in production

Client Development build specific:

When using Expo, the EXPO_PUBLIC_ prefix is required to make environment variables available to the app's code. This makes them accessible, but it also means that all prefixed variables are publicly exposed in the JS bundle, so it's crucial to avoid using this method for secrets in production builds.

Image description

Production build specific:

Use expoConfig?.extra variables from app.json file

Image description

Use Expo's Constants.expoCongif.extra to access your variables

Image description

Image description


This content originally appeared on DEV Community and was authored by amanbhoria


Print Share Comment Cite Upload Translate Updates
APA

amanbhoria | Sciencx (2024-09-12T18:56:01+00:00) #2 – Expo apk keeps on crashing after build. Retrieved from https://www.scien.cx/2024/09/12/2-expo-apk-keeps-on-crashing-after-build/

MLA
" » #2 – Expo apk keeps on crashing after build." amanbhoria | Sciencx - Thursday September 12, 2024, https://www.scien.cx/2024/09/12/2-expo-apk-keeps-on-crashing-after-build/
HARVARD
amanbhoria | Sciencx Thursday September 12, 2024 » #2 – Expo apk keeps on crashing after build., viewed ,<https://www.scien.cx/2024/09/12/2-expo-apk-keeps-on-crashing-after-build/>
VANCOUVER
amanbhoria | Sciencx - » #2 – Expo apk keeps on crashing after build. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/12/2-expo-apk-keeps-on-crashing-after-build/
CHICAGO
" » #2 – Expo apk keeps on crashing after build." amanbhoria | Sciencx - Accessed . https://www.scien.cx/2024/09/12/2-expo-apk-keeps-on-crashing-after-build/
IEEE
" » #2 – Expo apk keeps on crashing after build." amanbhoria | Sciencx [Online]. Available: https://www.scien.cx/2024/09/12/2-expo-apk-keeps-on-crashing-after-build/. [Accessed: ]
rf:citation
» #2 – Expo apk keeps on crashing after build | amanbhoria | Sciencx | https://www.scien.cx/2024/09/12/2-expo-apk-keeps-on-crashing-after-build/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.