Capacitor has no built-in rollback for failed upgrades: track the native projects or regenerate them?
0 reputation · 06 Aug 2025, 18:57 UTC
0 reputation · 06 Aug 2025, 18:57 UTC
A Capacitor upgrade touches two layers: the npm packages (@capacitor/core, @capacitor/cli, and the platform packages) and the native ios/ and android/ projects, updated through the documented sync step that copies web assets and plugin configuration. Because those native directories are real, editable projects, there is no built-in rollback for a failed upgrade; recovery rests on version control or on regenerating a platform.
Two constraints complicate the choice:
ios/ and android/ preserves manual native customizations and makes a git revert a candidate recovery path, but it complicates regeneration-based rollback.Major-version upgrades can also require toolchain-side changes (Xcode, Android Studio, Gradle), so reverting app code may not undo everything an upgrade touched. Exact steps vary by major version and should be checked against the matching upgrade guide.
For a team standardizing on one approach:
package.json and reinstalling dependencies fully restore a working build when the native directories are tracked?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.