pmadruga / react-native-clean-project

Automating the clean up of a React Native project
MIT License
1.21k stars 53 forks source link

Xcode build cache not cleaned #18

Closed mikehardy closed 5 years ago

mikehardy commented 5 years ago

Hello there again good sir :-)

I just had a problem with react-native-firebase after making some changes there that removed whole files. Turns out Xcode has some more secret state that sometimes needs to be blown away, but it’s not done (yet) by react-native-clean-project

https://github.com/invertase/react-native-firebase/issues/2269#issuecomment-506135988 https://gist.github.com/maciekish/66b6deaa7bc979d0a16c50784e16d697

killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
mikehardy commented 5 years ago

Following these steps fixed an otherwise-mysterious issue (linked here) where iOS builds worked in debug and release, but not archive. Would have been fiendish to figure out without knowing of them, this could solve a tough class of problems for people

pmadruga commented 5 years ago

Thanks @mikehardy 👍