Closed deno028 closed 2 years ago
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.
yarn add https://github.com/luggit/react-native-config.git
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.
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.
yarn add https://github.com/luggit/react-native-config.git
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.
0.12
don't work with React Native 0.6+
auto linking or not.
I was obliged to downgrade to 0.11.7
and link the module manually, thanks to:
https://github.com/luggit/react-native-config/issues/414#issuecomment-559014103
@nicolashemonic do you have the GeneratedInfoPlistDotEnv.h
in any of the preprocessing build settings?
I no longer needed the dependency and I removed it and it's pods, however I kept getting the following error:
The fix was simple yet time consuming:
${BUILD_DIR}/GeneratedInfoPlistDotEnv.h
from Info.plist Preprocessor Prefix File
Preprocess Info.plist File
to No
@nicolashemonic Perhaps this will help: https://github.com/luggit/react-native-config/issues/391#issuecomment-571948199
@denisdimitrov Just followed your suggestion.
https://github.com/luggit/react-native-config/issues/391#issuecomment-632331803 describes how to generate the file, so it should give the right hint for anyone who needs to remove it.
Setting
${CONFIGURATION_BUILD_DIR}/GeneratedInfoPlistDotEnv.h
on the project ONLY is what worked for me after trying everything else.
Thanks @moroz0v, this worked for me. Setting it ONLY on project and NOT on the targets is the secret here.
My solution was pretty specific - mine was failing only when testing with Detox, but working fine with normal run-ios
. I fixed it by changing this setting in my Detox build command:
-derivedDataPath ios/build
To point to the Xcode DerivedData directory, where the .h file can actually be found:
/Users/me/Library/Developer/Xcode/DerivedData/mobile2mr-xxxx
for anyone who couldn't find a solution, how i solved mine was to navigate to the folder that was mentioned in the error message. mine was /Users/user/Library/Developer/Xcode/DerivedData/app-gehbcoezzoencvciaviqaurqghcg/Build
and ran this code in the terminal at that folder, touch GeneratedDotEnv.m GeneratedInfoPlistDotEnv.h && echo "#define DOT_ENV @{ };" >> GeneratedDotEnv.m
. cleaned the project and it worked :))
If anyone is still having the problem, my issue was that I was opening Xcode in ios folder, what solved it for my was opening xcworkspace file from Xcode.
Sorry guys, I've been offline for a while. I think new versions this issue was solved.
We fixed by removing the requirements for GeneratedInfoPlistDotEnv.h
, since it's not recommended by the react-native-config
Readme anymore, and then we followed the instructions towards Config.xcconfig enabling env vars in Info.plist: https://github.com/luggit/react-native-config#availability-in-build-settings-and-infoplist, making sure that our Info.plist was using the proper $(VAR)
syntax.
I am using Apple M2 chip I fixed it by using rosetta mode and it is working fine for me go to Product->destination-> destination architecture -> select "show Rosetta Destination"
I created a new scheme with new Configuration build : releaseDev
"react-native": "0.37.0", "react-native-config": "^0.3.0",
When archiving I got this error:
fatal error: '/Users/xxx/Library/Developer/Xcode/DerivedData/MyProject-xxx/Build/Intermediates/ArchiveIntermediates/myDevScheme/BuildProductsPath/ReleaseDev-iphoneos/GeneratedInfoPlistDotEnv.h' file not found
Notes: it works with default configuration builds: release and debug.