0

I use from react-native-config in my project and my .env file exist in a sub folder rather than root path. In build.gradle file i have:

project.env.get("APP_VERSION_CODE").toInteger()

but when i run the app:

* What went wrong:
A problem occurred evaluating project ':app'.
> Cannot invoke method toInteger() on null object

When i copy .env file to root path it work correct.How can i change default .env file path from root to other sub folder??

hossein ketabi
  • 480
  • 7
  • 19

1 Answers1

0

Try moving .env file to root folder and also check whether file have "APP_VERSION_CODE" defined. To use env file in other folder you need to add plugin manually in android and ios to access the env file.

Amol Gangadhare
  • 1,059
  • 2
  • 11
  • 24