Skip to content
Latchkey

Capacitor "is not implemented on" platform in CI E2E

Capacitor plugins have per-platform implementations. When CI runs an end-to-end or unit suite against a platform where the plugin has no implementation (often web), or when sync did not register the native code, the call throws "not implemented on" that platform.

What this error means

A test or build-time check fails with "Plugin X does not have web implementation" or "X.method is not implemented on android", failing the CI job.

Capacitor
Error: "Camera" plugin is not implemented on web
        at createPluginMethod (capacitor.js)

Common causes

The plugin has no implementation for the test platform

Running web-based tests calls a native-only plugin that has no web implementation, so Capacitor throws at call time.

cap sync did not register the native plugin

After adding a plugin, sync must run so the native project registers it. Skipping sync leaves the platform without the implementation.

How to fix it

Sync after adding plugins, and guard platform calls

  1. Run npx cap sync after installing any plugin.
  2. Guard native-only calls with Capacitor.isNativePlatform() in code under test.
  3. Mock the plugin in web/unit tests.
src/photo.ts
import { Capacitor } from '@capacitor/core';
if (Capacitor.isNativePlatform()) {
  await Camera.getPhoto({ /* ... */ });
}

Register plugins by syncing in CI

Ensure cap sync runs in the pipeline so each platform picks up the plugin native code before tests or builds.

.github/workflows/ci.yml
- run: npm ci && npm run build
- run: npx cap sync

How to prevent it

  • Run cap sync after every plugin change.
  • Guard native-only plugin calls by platform.
  • Mock native plugins in web and unit tests.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →