Open ToshKoevoets opened 10 months ago
i just run into the same problem, is this a new? I had the impression it worked before without deleting derivedData
@luancurti
Same issue, initially suspected it might be related to our project. However, after testing 'Example/0.68.5', it appears the issue is not project-related.
I have added the script to delete the build cache before every building
This works file!!
For prod it's a good idea, for dev would make it unnecessarily slow
Op do 7 sep 2023 om 11:58 schreef Takagi Kensuke @.***>:
I have added the script to delete the build cache before every building [image: image] https://user-images.githubusercontent.com/43239/266280119-77cfc63d-8ec9-42d9-9ee7-633ad9a4e6a1.png
This works file!!
— Reply to this email directly, view it on GitHub https://github.com/luggit/react-native-config/issues/774#issuecomment-1709864979, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJEFAD4EWYHE4B7BVDBZWDXZGLDBANCNFSM6AAAAAA37SCGUI . You are receiving this because you authored the thread.Message ID: @.***>
I'm having the same issue, but fixed it in suggested way on deleting rn-config cache.
Question is, do you know why this is happening?
@uwbobanminic
react-native-config generates a native-readable source file for each platform, before building
That's why deleting the cache works so well
I think it would be good to add a comparison the last modification time of .env
and the one of the last build, and regenerates if those are different
ToshKoevoets macrozone januswel uwbobanminic midrizi The easiest way for now is to add script rm "${SRCROOT}/../node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m" This will not hamper your derived folder
Just add this script inside build phase click + and then New run script phase ->> Then add The above line but make sure to place the script at top of every one
if you have multiple Targets then add in each target Build phase same script Attaching screen shot reference
Please, how can this be done for Android?
In my experience i need to clean my build everytime i switch to another scheme before running it on the device using XCode. Sure this slowing down the build time significantly.
But if i run the app through the cli without cleaning the build then it works. I don't to need to clean the build everytime i switch between scheme. I run it like this:
ENVFILE=.env.production react-native run-ios --scheme 'YourProdScheme'
So for now i always run the ios app through the cli and doesn't therough XCode.
Hope it helps someone, thanks.
ToshKoevoets macrozone januswel uwbobanminic midrizi The easiest way for now is to add script rm "${SRCROOT}/../node_modules/react-native-config/ios/ReactNativeConfig/GeneratedDotEnv.m" This will not hamper your derived folder
Just add this script inside build phase click + and then New run script phase ->> Then add The above line but make sure to place the script at top of every one
if you have multiple Targets then add in each target Build phase same script Attaching screen shot reference
Thanks, This help me a lot
Every time I rebuild with different .env values in the IOS simulator I have to delete deriveddata, which makes rebuilding slow; also takes a long time for developers to figure out, hence bunch of issues saying it either doesn't work, have to run pod install etc.