Skip to main content

Napacitor CLI - nap sync

Copy the web build output into the host and regenerate napacitor.build.props, which wires the C# plugin projects into the MAUI host build.

npx nap sync [maui]

Behavior:

  1. Runs copy: copies webDir into the host wwwroot.
  2. Regenerates maui/napacitor.build.props — a generated MSBuild props file that adds <ProjectReference> entries for every installed @napacitor/* plugin's maui/ C# project.

When to run:

  • After installing or updating any @napacitor/* plugin.
  • After building your web app (instead of nap copy).

Example:

npm install @napacitor/device
npm run build
npx nap sync

Forgetting to run nap sync after adding a plugin is the most common cause of "plugin not registered" / NOT_IMPLEMENTED errors at runtime — the plugin assembly is never referenced by the host until the props file is regenerated.