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:
- Runs
copy: copieswebDirinto the hostwwwroot. - Regenerates
maui/napacitor.build.props— a generated MSBuild props file that adds<ProjectReference>entries for every installed@napacitor/*plugin'smaui/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 syncafter adding a plugin is the most common cause of "plugin not registered" /NOT_IMPLEMENTEDerrors at runtime — the plugin assembly is never referenced by the host until the props file is regenerated.