I had a react native project that was building and running perfectly fine. Then I decided to move it into a sub directory, and I started receiving lots of precompiled header errors:
PCH was compiled with module cache path '/Users/me/place1/ios/build/ModuleCache/3R9LOJFOBFZVJ', but the path is currently
'/Users/me/place2/app/ios/build/ModuleCache/3R9LOJFOBFZVJ'
Fair enough, but what's weird is that, if I open up the xcode project and clean / rebuild in there, everything works!
Then when I close down the server started by xcode and try to launch it using react-native run-ios
it continues to complain about PCH issues.
Not sure what I'm missing...
If you are already familiar with mobile development, you may want to use React Native CLI. It requires Xcode or Android Studio to get started. If you already have one of these tools installed, you should be able to get up and running within a few minutes.
To clean the iOS build press Option+Shift+Command+K or go to Xcode menu Product -> Clean Build Folder.
To summarize, ios/build folder contains final installation app files, auxiliary files and precompiled modules, various logs and source code index.
Sorry to answer my own, but turns out it's safe to just delete the whole build directory at /path/to/project/ios/build
. After that it rebuilt fine for me :)
No need to delete whole build directory but delete ModuleCache
folder at /path/to/project/ios/build/ModuleCache
and then react-native run-ios
worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With