Skip to content
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

GeneratedInfoPlistDotEnv.h not updated on cmd-builds (iOS) #710

Open
rafaelmaeuer opened this issue Dec 7, 2022 · 4 comments
Open

GeneratedInfoPlistDotEnv.h not updated on cmd-builds (iOS) #710

rafaelmaeuer opened this issue Dec 7, 2022 · 4 comments

Comments

@rafaelmaeuer
Copy link
Contributor

Today I was wondering why my .env-vars were not updated on iOS when building the app from cmd.
It works fine when the build is triggered from Xcode directly, so that seemed a little curious to me.

I use app-version and build-number from .env to sync iOS and Android-versions. I noticed a mismatch of build-numbers when reading directly from Config.APP_BUILD (not updated) and DeviceInfo.getBuildNumber() (updated). As DeviceInfo gets the information from info.plist, the updated var was somewhere lost on the way into the JS-code.

After some investigation and reading lots of issues here, I came to the point that GeneratedInfoPlistDotEnv.h was not updated, when building the app from command-line using npx react-native run-ios. So my current workaround is another preprocess-script that deletes the file before every build. It forces the file to be re-generated and the updated var is available in JS too:

Bildschirmfoto 2022-12-07 um 15 38 37

If anyone knows a better fix or solution please let me know!

@rafaelmaeuer
Copy link
Contributor Author

rafaelmaeuer commented Dec 7, 2022

Maybe #409, #591, #615 and #698 are related?

Solution inspired by How do I force Xcode to rebuild the Info.plist file in my project every time I build the project?

@ujosat
Copy link

ujosat commented Jan 6, 2023

Use 1.4.4

@StationSoen
Copy link

Are there any updates on this? It's still happening 😢

@rafaelmaeuer
Copy link
Contributor Author

rafaelmaeuer commented Oct 17, 2024

Still valid, can't believe it as almost 2 years have passed - using following pre-action script:

# react-native-config: remove built file (fix) and generate xcconfig
rm -f ${BUILD_DIR}/GeneratedInfoPlistDotEnv.h
"${SRCROOT}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildXCConfig.rb" "${SRCROOT}/.." "${SRCROOT}/tmp.xcconfig"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants