NinetyHH
NinetyHH

Reputation: 1464

React-Native: Build error GeneratedInfoPlistDotEnv.h file not found

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

Upvotes: 0

Views: 3902

Answers (3)

Justin Joy
Justin Joy

Reputation: 393

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.

Upvotes: 0

Sam Hoult
Sam Hoult

Reputation: 101

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

Image of code in Xcode 9

Upvotes: 2

Eric Guo
Eric Guo

Reputation: 21

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...

Upvotes: 2

Related Questions