We use CNG with
ios/
gitignored, and
npx expo run:ios
only runs prebuild when the folder is missing. So once
ios/
exists, it keeps building that same project after an SDK patch, a new native package or an app config change, until someone remembers to run
npx expo prebuild --clean
.
That bit us today. Our
ios/
was generated before the SDK 58 template moved to the UIScene lifecycle, so the dev build made with the iOS 27 SDK crashed at launch, and nothing in the output pointed at the stale project. A clean prebuild fixed it.
@expo/fingerprint
already knows when native inputs change, and it leaves the native folders out of the hash in a CNG project, so it could drive this. What we'd love is for
expo run
to save the fingerprint into
ios/
after each prebuild, and on the next run, when the fingerprint differs, say so and prebuild again (or at least warn, if regenerating unasked feels too aggressive).
For now our own dev launcher does it: it computes the fingerprint, compares it with the one we write into
ios/
after each prebuild, and runs
prebuild --clean
when they differ. It works fine, but every CNG project probably wants it, and it belongs next to the existing missing-folder check in
ensureNativeProject
.
Thanks!