0

I had a old React-Native project which I wanted to give it a try again and when trying to run the project on iOS (Android works perfect) I get the error that Debug-iphonesimulator/GeneratedInfoPlistDotEnv.h file not found. If I run the project from the command react-native run-ios, than the build will succeed.

What can cause this issue and how can it be fixed?

I have tried to fix it with the comments from this issue but no success.

React-Native verision: 0.47

Full error:

<built-in>:1:10: fatal error: '/Users/myUser/Library/Developer/Xcode/DerivedData/Project-gcaxrvbcwgkfhkadevoqxcprxszw/Build/Products/Debug-iphonesimulator/GeneratedInfoPlistDotEnv.h' file not found 

3 Answers 3

2

I fixed by copying file GeneratedInfoPlistDotEnv.h (in /ios/build/Build/Products/) to the path mentioned in the error message. The path mentioned in error message for simulator is not same as real phone, you need to copy for a second time.

The development for React Native just like droped in a deep black hole, what you need to do is just climb and climb and climb...

Sign up to request clarification or add additional context in comments.

2 Comments

After run in Xcode once, path for GeneratedInfoPlistDotEnv.h is ''$(rn project path)/ios/build/Build/Products/"
Looks like something is different, but still i receive other errors now.
2

Changing the Info.plist preprocessor prefix file to works for me ${CONFIGURATION_BUILD_DIR}/../GeneratedInfoPlistDotEnv.h

Image of code in Xcode 9

1 Comment

kind of annoyingly ambiguous that this worked. Thank you though!
0

If you're coming from React version 0.60 and above, you should be referencing the package from GitHub instead of NPM. The author hasn't released auto-linking support on NPM yet, even though it's already merged!?

Try these steps after you unlink and uninstall the existing version of react-native-config. Remember to revert to default Info.plist preprocessor settings in XCode build settings.

  1. yarn add https://github.com/luggit/react-native-config.git

  2. cd ios && pod install

You don't have to add any other post-install scripts, just run the app like usual and it should work fine. Make sure you undo any other fixes before doing this.

2 Comments

@iRohitBhatia Have you tried clearing your node modules, cache and derived data folders and doing a fresh install?
Tried deleting the build folder, clean cache and node_modules. None of them worked for me

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.