-
Notifications
You must be signed in to change notification settings - Fork 658
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
Cannot read env variable in info.plist #437
Comments
@germanp173 thanks, but It still does not work.
I got an error build/GeneratedInfoPlistDotEnv.h not found |
@MRSEREY sorry I should have been more clear and specified that the comment helped me by instructing me to remove those old settings which you just laid out (make sure you read the comment carefully). After I removed those If you didn't have any of those old settings in place then:
|
@germanp173 it didn't see even tmp.xcconfig in ios folder |
@germanp173 I can see tmp.xcconfig file now which contain my env there. But I still cannot access it in Info.plist. |
hi @MRSEREY , do you resolve this issue? Thanks |
@MRSEREY have you enabled "Provide build settings from " ? |
I ran into the same issue and fixed it by referencing the correct env variable name. It used to be: __RN_CONFIG_XXX For more details, have a look at the generating script: New way: https://github.com/luggit/react-native-config/blob/master/ios/ReactNativeConfig/BuildDotenvConfig.rb#L29 |
|
For me, there were two problems:
Worked perfectly after that 👍 |
I have follow the doc until:
Availability in Build settings and Info.plist
step 6. create new build phase for the scheme which will generate "tmp.xcconfig" before each build exposing values to Build Settings and Info.plist (this snippet has to be placed after "echo ... > tmp/envfile" if approach explained below is used)
echo ".env.staging" > /tmp/envfile
"${SRCROOT}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildXCConfig.rb" "${SRCROOT}/.." "${SRCROOT}/tmp.xcconfig"
Has anyone ever faced it?
Happy to see any comments
The text was updated successfully, but these errors were encountered: