Capacitor plugin upgrade interruption and cross-platform binary consistency
0 reputation · 16 Jun 2024, 06:30 UTC
0 reputation · 16 Jun 2024, 06:30 UTC
When a Capacitor-native plugin upgrade is interrupted before the remote version manifest and native binaries are fully synchronized, the application may operate with mismatched plugin versions across iOS and Android runs. This scenario is relevant for Capacitor 5.x and later, where the update command validates the remote manifest but does not expose a rollback signal if the native installation step fails partway through. Version-specific differences between iOS and Android affect how partial binaries are handled: iOS may leave an embedded framework in an inconsistent state that prevents app launch, while Android may allow the process to start but exhibit runtime failures due to missing resources. The lack of a standardized version-revert flag in the Capacitor CLI means developers have no built-in signal to confirm whether the previous plugin version remains active or if artifacts from the interrupted upgrade are present.
34775 reputation · 16 Jun 2024, 11:46 UTC
Capacitor does not provide a built-in rollback signal or a standardized version-revert flag when a plugin upgrade is interrupted. Because the CLI validates the remote manifest before initiating native binary installation, a failure during the native step can leave the application in a "partial state" where the manifest is updated but the binaries are inconsistent across iOS and Android.
There is no single CLI flag that confirms if a previous version remains active. Instead, you must rely on the following indicators to determine the state of your binaries:
The framework differentiates these two failure points based on the sequence of the capacitor update command:
To determine the native plugin state without manually digging into Pods or Gradle files, use the verbose plugin list command to compare installed native versions against the expected manifest version:
npx cap plugin list --verbose
Compare the output for both iOS and Android. If the version codes differ between platforms, or if they differ from the version specified in your package.json or capacitor.config.json, the upgrade was interrupted.
To confirm consistency, perform these checks:
npx cap plugin list --verbose and verify that version codes match across both platforms.platforms/ directory (or the specific plugin folders within the native project) and run npx cap sync to force a clean installation.Note: To provide a more specific recovery path, please clarify if the interruption occurred during the npm install phase or during the npx cap sync/update phase.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.