capacitor-plugins

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Capacitor Plugins

Capacitor插件

Install, configure, and use Capacitor plugins from official and community sources.
安装、配置并使用来自官方及社区来源的Capacitor插件。

Prerequisites

前置条件

  1. Capacitor 6, 7, or 8 app.
  2. Node.js and npm installed.
  3. For iOS plugins: Xcode installed. CocoaPods or Swift Package Manager (SPM) for dependency management.
  4. For Android plugins: Android Studio installed.
  1. Capacitor 6、7或8 应用。
  2. 已安装Node.js和npm。
  3. 若使用iOS插件:需安装Xcode,且使用CocoaPods或Swift Package Manager(SPM)进行依赖管理。
  4. 若使用Android插件:需安装Android Studio。

Agent Behavior

Agent行为规范

  • Guide step-by-step. Walk the user through the process one step at a time. Never present multiple unrelated questions at once.
  • Auto-detect before asking. Check the project for platforms (
    android/
    ,
    ios/
    ), build tools (
    vite.config.ts
    ,
    angular.json
    ,
    webpack.config.js
    ), framework, existing npm registry config, and
    package.json
    dependencies. Only ask the user when something cannot be detected.
  • One decision at a time. When a step requires user input (e.g., encryption yes/no), ask that single question, wait for the answer, then continue to the next step.
  • Present clear options. When asking a question, provide concrete choices (e.g., "Do you need SQLite encryption? (yes/no)") instead of open-ended questions.
  • 分步引导:逐步引导用户完成流程,切勿同时抛出多个不相关的问题。
  • 先自动检测再询问:检查项目中的平台目录(
    android/
    ios/
    )、构建工具(
    vite.config.ts
    angular.json
    webpack.config.js
    )、框架、现有npm registry配置以及
    package.json
    中的依赖项。仅当无法自动检测时才向用户询问。
  • 一次一个决策:当步骤需要用户输入时(如是否启用加密),仅提出该单个问题,等待用户回复后再继续下一步。
  • 提供明确选项:询问问题时给出具体选项(例如:“是否需要SQLite加密?(是/否)”),而非开放式问题。

Procedures

操作流程

Step 1: Identify the Plugin

步骤1:确定插件

Match the user's request to a plugin from the index below. If the match is ambiguous, ask the user to clarify.
将用户的需求与下方索引中的插件进行匹配。若匹配存在歧义,请让用户进行澄清。

Step 2: Read the Reference File

步骤2:查阅参考文件

Read the corresponding reference file from
references/
for the matched plugin.
为匹配到的插件查阅
references/
目录下对应的参考文件。

Step 3: Analyze the Project

步骤3:分析项目

Auto-detect the following by reading project files — do not ask the user for information that can be inferred:
  1. Platforms: Check which directories exist (
    android/
    ,
    ios/
    ). These are the platforms to configure.
  2. Build tool / framework: Check for
    vite.config.ts
    ,
    angular.json
    ,
    webpack.config.js
    ,
    next.config.js
    , etc.
  3. iOS dependency manager: Check if
    ios/App/Podfile
    exists (CocoaPods) or if SPM is used.
  4. Capacitor version: Read
    @capacitor/core
    version from
    package.json
    .
通过读取项目文件自动检测以下信息——切勿向用户询问可通过推断获取的信息:
  1. 平台:检查是否存在对应目录(
    android/
    ios/
    ),这些即为需要配置的平台。
  2. 构建工具/框架:检查是否存在
    vite.config.ts
    angular.json
    webpack.config.js
    next.config.js
    等文件。
  3. iOS依赖管理器:检查是否存在
    ios/App/Podfile
    (CocoaPods)或是否使用SPM。
  4. Capacitor版本:从
    package.json
    中读取
    @capacitor/core
    的版本。

Step 4: Set Up Prerequisites

步骤4:配置前置要求

If the plugin requires Capawesome Insiders (the reference file states
Capawesome Insiders: Yes
):
  1. Check if the
    @capawesome-team
    npm registry is already configured by running:
    npm config get @capawesome-team:registry
  2. If the registry is not configured, tell the user this plugin requires a Capawesome Insiders license and guide them through the setup:
    bash
    npm config set @capawesome-team:registry https://npm.registry.capawesome.io
    npm config set //npm.registry.capawesome.io/:_authToken <YOUR_LICENSE_KEY>
    Ask the user for their license key if needed. Wait for confirmation before continuing.
  3. If the registry is already configured, skip this and move on.
若插件需要Capawesome Insiders(参考文件中标记为
Capawesome Insiders: Yes
):
  1. 通过运行以下命令检查是否已配置
    @capawesome-team
    npm registry:
    bash
    npm config get @capacitor-team:registry
  2. 若registry未配置,告知用户该插件需要Capawesome Insiders许可证,并引导其完成配置:
    bash
    npm config set @capawesome-team:registry https://npm.registry.capawesome.io
    npm config set //npm.registry.capawesome.io/:_authToken <YOUR_LICENSE_KEY>
    若需要,请向用户索要许可证密钥。等待用户确认后再继续。
  3. 若registry已配置,则跳过此步骤,继续下一步。

Step 5: Install the Plugin

步骤5:安装插件

Run the installation command from the reference file:
bash
npm install <package-name>
npx cap sync
If the reference file lists additional packages (e.g.,
@sqlite.org/sqlite-wasm
), include them.
运行参考文件中的安装命令:
bash
npm install <package-name>
npx cap sync
若参考文件中列出了额外的包(如
@sqlite.org/sqlite-wasm
),请一并安装。

Step 6: Apply Platform-Specific Configuration

步骤6:应用平台专属配置

For each platform detected in Step 3, apply the configuration from the reference file.
When the reference file offers variants or optional features for a platform (e.g., encryption vs. plain, bundled SQLite vs. default), handle them one at a time:
  1. Present the choice to the user with a clear question and options.
  2. Wait for the user's answer.
  3. Apply only the chosen configuration.
  4. Move on to the next platform or decision point.
Typical configuration includes:
  • Android: Gradle variables in
    variables.gradle
    , permissions in
    AndroidManifest.xml
    , meta-data entries, ProGuard rules
  • iOS:
    Info.plist
    entries, Podfile or SPM changes,
    AppDelegate.swift
    modifications
Skip platforms that don't exist in the project.
针对步骤3中检测到的每个平台,应用参考文件中的配置。
当参考文件针对某平台提供变体或可选功能时(如加密版 vs 普通版、捆绑SQLite vs 默认版),需逐一处理:
  1. 以清晰的问题和选项向用户呈现选择。
  2. 等待用户回复。
  3. 仅应用用户选择的配置。
  4. 进入下一个平台或决策点。
典型配置包括:
  • Android
    variables.gradle
    中的Gradle变量、
    AndroidManifest.xml
    中的权限、元数据条目、ProGuard规则
  • iOS
    Info.plist
    条目、Podfile或SPM修改、
    AppDelegate.swift
    调整
跳过项目中不存在的平台。

Step 7: Apply Web Configuration (if applicable)

步骤7:应用Web配置(如适用)

If the reference file includes a Web configuration section and the project targets the web:
  1. Apply the configuration matching the detected build tool (Vite, Webpack, Angular CLI, etc.).
  2. If the build tool is not covered by the reference file, adapt the configuration to the detected build tool and inform the user.
若参考文件包含Web配置章节且项目面向Web平台:
  1. 应用与检测到的构建工具(Vite、Webpack、Angular CLI等)匹配的配置。
  2. 若参考文件未覆盖该构建工具,需根据检测到的构建工具调整配置并告知用户。

Step 8: Add Usage Code

步骤8:添加使用代码

Ask the user if they want usage code added to the project. If yes:
  1. Add the usage code from the reference file.
  2. Adapt imports, method calls, and options to match the user's project structure and requirements.
询问用户是否需要在项目中添加使用代码。若用户同意:
  1. 添加参考文件中的使用代码。
  2. 根据用户的项目结构和需求调整导入语句、方法调用及选项。

Step 9: Sync the Project

步骤9:同步项目

bash
npx cap sync
bash
npx cap sync

Plugin Index

插件索引

Official Capacitor Plugins

官方Capacitor插件

PluginPackageReference
Action Sheet
@capacitor/action-sheet
references/capacitor-action-sheet.md
App
@capacitor/app
references/capacitor-app.md
App Launcher
@capacitor/app-launcher
references/capacitor-app-launcher.md
Background Runner
@capacitor/background-runner
references/capacitor-background-runner.md
Barcode Scanner
@capacitor/barcode-scanner
references/capacitor-barcode-scanner.md
Browser
@capacitor/browser
references/capacitor-browser.md
Camera
@capacitor/camera
references/capacitor-camera.md
Clipboard
@capacitor/clipboard
references/capacitor-clipboard.md
Cookies
@capacitor/core
(bundled)
references/capacitor-cookies.md
Device
@capacitor/device
references/capacitor-device.md
Dialog
@capacitor/dialog
references/capacitor-dialog.md
File Transfer
@capacitor/file-transfer
references/capacitor-file-transfer.md
File Viewer
@capacitor/file-viewer
references/capacitor-file-viewer.md
Filesystem
@capacitor/filesystem
references/capacitor-filesystem.md
Geolocation
@capacitor/geolocation
references/capacitor-geolocation.md
Google Maps
@capacitor/google-maps
references/capacitor-google-maps.md
Haptics
@capacitor/haptics
references/capacitor-haptics.md
Http
@capacitor/core
(bundled)
references/capacitor-http.md
InAppBrowser
@capacitor/inappbrowser
references/capacitor-inappbrowser.md
Keyboard
@capacitor/keyboard
references/capacitor-keyboard.md
Local Notifications
@capacitor/local-notifications
references/capacitor-local-notifications.md
Motion
@capacitor/motion
references/capacitor-motion.md
Network
@capacitor/network
references/capacitor-network.md
Preferences
@capacitor/preferences
references/capacitor-preferences.md
Privacy Screen
@capacitor/privacy-screen
references/capacitor-privacy-screen.md
Push Notifications
@capacitor/push-notifications
references/capacitor-push-notifications.md
Screen Orientation
@capacitor/screen-orientation
references/capacitor-screen-orientation.md
Screen Reader
@capacitor/screen-reader
references/capacitor-screen-reader.md
Share
@capacitor/share
references/capacitor-share.md
Splash Screen
@capacitor/splash-screen
references/capacitor-splash-screen.md
Status Bar
@capacitor/status-bar
references/capacitor-status-bar.md
System Bars
@capacitor/core
(bundled)
references/capacitor-system-bars.md
Text Zoom
@capacitor/text-zoom
references/capacitor-text-zoom.md
Toast
@capacitor/toast
references/capacitor-toast.md
Watch
@capacitor/watch
references/capacitor-watch.md
插件包名参考文件
操作菜单
@capacitor/action-sheet
references/capacitor-action-sheet.md
应用核心
@capacitor/app
references/capacitor-app.md
应用启动器
@capacitor/app-launcher
references/capacitor-app-launcher.md
后台运行器
@capacitor/background-runner
references/capacitor-background-runner.md
条码扫描器
@capacitor/barcode-scanner
references/capacitor-barcode-scanner.md
浏览器
@capacitor/browser
references/capacitor-browser.md
相机
@capacitor/camera
references/capacitor-camera.md
剪贴板
@capacitor/clipboard
references/capacitor-clipboard.md
Cookies
@capacitor/core
(内置)
references/capacitor-cookies.md
设备信息
@capacitor/device
references/capacitor-device.md
对话框
@capacitor/dialog
references/capacitor-dialog.md
文件传输
@capacitor/file-transfer
references/capacitor-file-transfer.md
文件查看器
@capacitor/file-viewer
references/capacitor-file-viewer.md
文件系统
@capacitor/filesystem
references/capacitor-filesystem.md
地理定位
@capacitor/geolocation
references/capacitor-geolocation.md
Google地图
@capacitor/google-maps
references/capacitor-google-maps.md
触觉反馈
@capacitor/haptics
references/capacitor-haptics.md
Http
@capacitor/core
(内置)
references/capacitor-http.md
内置浏览器
@capacitor/inappbrowser
references/capacitor-inappbrowser.md
键盘
@capacitor/keyboard
references/capacitor-keyboard.md
本地通知
@capacitor/local-notifications
references/capacitor-local-notifications.md
运动传感器
@capacitor/motion
references/capacitor-motion.md
网络状态
@capacitor/network
references/capacitor-network.md
偏好设置
@capacitor/preferences
references/capacitor-preferences.md
隐私屏幕
@capacitor/privacy-screen
references/capacitor-privacy-screen.md
推送通知
@capacitor/push-notifications
references/capacitor-push-notifications.md
屏幕方向
@capacitor/screen-orientation
references/capacitor-screen-orientation.md
屏幕阅读器
@capacitor/screen-reader
references/capacitor-screen-reader.md
分享
@capacitor/share
references/capacitor-share.md
启动屏
@capacitor/splash-screen
references/capacitor-splash-screen.md
状态栏
@capacitor/status-bar
references/capacitor-status-bar.md
系统栏
@capacitor/core
(内置)
references/capacitor-system-bars.md
文本缩放
@capacitor/text-zoom
references/capacitor-text-zoom.md
提示框
@capacitor/toast
references/capacitor-toast.md
手表集成
@capacitor/watch
references/capacitor-watch.md

Capawesome Plugins

Capawesome插件

PluginPackageReference
Accelerometer
@capawesome-team/capacitor-accelerometer
references/capawesome-accelerometer.md
Age Signals
@capawesome/capacitor-age-signals
references/capawesome-age-signals.md
Android Battery Optimization
@capawesome-team/capacitor-android-battery-optimization
references/capawesome-android-battery-optimization.md
Android Dark Mode Support
@capawesome/capacitor-android-dark-mode-support
references/capawesome-android-dark-mode-support.md
Android Edge-to-Edge Support
@capawesome/capacitor-android-edge-to-edge-support
references/capawesome-android-edge-to-edge-support.md
Android Foreground Service
@capawesome-team/capacitor-android-foreground-service
references/capawesome-android-foreground-service.md
App Review
@capawesome/capacitor-app-review
references/capawesome-app-review.md
App Shortcuts
@capawesome/capacitor-app-shortcuts
references/capawesome-app-shortcuts.md
App Update
@capawesome/capacitor-app-update
references/capawesome-app-update.md
Apple Sign In
@capawesome/capacitor-apple-sign-in
references/capawesome-apple-sign-in.md
Asset Manager
@capawesome/capacitor-asset-manager
references/capawesome-asset-manager.md
Audio Player
@capawesome-team/capacitor-audio-player
references/capawesome-audio-player.md
Audio Recorder
@capawesome-team/capacitor-audio-recorder
references/capawesome-audio-recorder.md
Background Task
@capawesome/capacitor-background-task
references/capawesome-background-task.md
Badge
@capawesome/capacitor-badge
references/capawesome-badge.md
Barometer
@capawesome-team/capacitor-barometer
references/capawesome-barometer.md
Biometrics
@capawesome-team/capacitor-biometrics
references/capawesome-biometrics.md
Bluetooth Low Energy
@capawesome-team/capacitor-bluetooth-low-energy
references/capawesome-bluetooth-low-energy.md
Cloudinary
@capawesome/capacitor-cloudinary
references/capawesome-cloudinary.md
Contacts
@capawesome-team/capacitor-contacts
references/capawesome-contacts.md
Datetime Picker
@capawesome-team/capacitor-datetime-picker
references/capawesome-datetime-picker.md
File Compressor
@capawesome-team/capacitor-file-compressor
references/capawesome-file-compressor.md
File Opener
@capawesome-team/capacitor-file-opener
references/capawesome-file-opener.md
File Picker
@capawesome/capacitor-file-picker
references/capawesome-file-picker.md
Geocoder
@capawesome-team/capacitor-geocoder
references/capawesome-geocoder.md
Google Sign In
@capawesome/capacitor-google-sign-in
references/capawesome-google-sign-in.md
libSQL
@capawesome/capacitor-libsql
references/capawesome-libsql.md
Live Update
@capawesome/capacitor-live-update
references/capawesome-live-update.md
Managed Configurations
@capawesome/capacitor-managed-configurations
references/capawesome-managed-configurations.md
Media Session
@capawesome-team/capacitor-media-session
references/capawesome-media-session.md
NFC
@capawesome-team/capacitor-nfc
references/capawesome-nfc.md
OAuth
@capawesome-team/capacitor-oauth
references/capawesome-oauth.md
Pedometer
@capawesome-team/capacitor-pedometer
references/capawesome-pedometer.md
Photo Editor
@capawesome/capacitor-photo-editor
references/capawesome-photo-editor.md
PostHog
@capawesome/capacitor-posthog
references/capawesome-posthog.md
Printer
@capawesome-team/capacitor-printer
references/capawesome-printer.md
Purchases
@capawesome-team/capacitor-purchases
references/capawesome-purchases.md
RealtimeKit
@capawesome/capacitor-realtimekit
references/capawesome-realtimekit.md
Screen Orientation
@capawesome/capacitor-screen-orientation
references/capawesome-screen-orientation.md
Screenshot
@capawesome/capacitor-screenshot
references/capawesome-screenshot.md
Secure Preferences
@capawesome-team/capacitor-secure-preferences
references/capawesome-secure-preferences.md
Share Target
@capawesome-team/capacitor-share-target
references/capawesome-share-target.md
Speech Recognition
@capawesome-team/capacitor-speech-recognition
references/capawesome-speech-recognition.md
Speech Synthesis
@capawesome-team/capacitor-speech-synthesis
references/capawesome-speech-synthesis.md
SQLite
@capawesome-team/capacitor-sqlite
references/capawesome-sqlite.md
Square Mobile Payments
@capawesome/capacitor-square-mobile-payments
references/capawesome-square-mobile-payments.md
Superwall
@capawesome/capacitor-superwall
references/capawesome-superwall.md
Torch
@capawesome/capacitor-torch
references/capawesome-torch.md
Wi-Fi
@capawesome-team/capacitor-wifi
references/capawesome-wifi.md
Zip
@capawesome-team/capacitor-zip
references/capawesome-zip.md
插件包名参考文件
加速度传感器
@capawesome-team/capacitor-accelerometer
references/capawesome-accelerometer.md
年龄信号
@capawesome/capacitor-age-signals
references/capawesome-age-signals.md
Android电池优化
@capawesome-team/capacitor-android-battery-optimization
references/capawesome-android-battery-optimization.md
Android深色模式支持
@capawesome/capacitor-android-dark-mode-support
references/capawesome-android-dark-mode-support.md
Android全屏支持
@capawesome/capacitor-android-edge-to-edge-support
references/capawesome-android-edge-to-edge-support.md
Android前台服务
@capawesome-team/capacitor-android-foreground-service
references/capawesome-android-foreground-service.md
应用评分
@capawesome/capacitor-app-review
references/capawesome-app-review.md
应用快捷方式
@capawesome/capacitor-app-shortcuts
references/capawesome-app-shortcuts.md
应用更新
@capawesome/capacitor-app-update
references/capawesome-app-update.md
Apple登录
@capawesome/capacitor-apple-sign-in
references/capawesome-apple-sign-in.md
资源管理器
@capawesome/capacitor-asset-manager
references/capawesome-asset-manager.md
音频播放器
@capawesome-team/capacitor-audio-player
references/capawesome-audio-player.md
音频录制器
@capawesome-team/capacitor-audio-recorder
references/capawesome-audio-recorder.md
后台任务
@capawesome/capacitor-background-task
references/capawesome-background-task.md
角标
@capawesome/capacitor-badge
references/capawesome-badge.md
气压计
@capawesome-team/capacitor-barometer
references/capawesome-barometer.md
生物识别
@capawesome-team/capacitor-biometrics
references/capawesome-biometrics.md
低功耗蓝牙
@capawesome-team/capacitor-bluetooth-low-energy
references/capawesome-bluetooth-low-energy.md
Cloudinary集成
@capawesome/capacitor-cloudinary
references/capawesome-cloudinary.md
联系人
@capawesome-team/capacitor-contacts
references/capawesome-contacts.md
日期时间选择器
@capawesome-team/capacitor-datetime-picker
references/capawesome-datetime-picker.md
文件压缩器
@capawesome-team/capacitor-file-compressor
references/capawesome-file-compressor.md
文件打开器
@capawesome-team/capacitor-file-opener
references/capawesome-file-opener.md
文件选择器
@capawesome/capacitor-file-picker
references/capawesome-file-picker.md
地理编码
@capawesome-team/capacitor-geocoder
references/capawesome-geocoder.md
Google登录
@capawesome/capacitor-google-sign-in
references/capawesome-google-sign-in.md
libSQL集成
@capawesome/capacitor-libsql
references/capawesome-libsql.md
实时更新
@capawesome/capacitor-live-update
references/capawesome-live-update.md
托管配置
@capawesome/capacitor-managed-configurations
references/capawesome-managed-configurations.md
媒体会话
@capawesome-team/capacitor-media-session
references/capawesome-media-session.md
NFC
@capawesome-team/capacitor-nfc
references/capawesome-nfc.md
OAuth认证
@capawesome-team/capacitor-oauth
references/capawesome-oauth.md
计步器
@capawesome-team/capacitor-pedometer
references/capawesome-pedometer.md
图片编辑器
@capawesome/capacitor-photo-editor
references/capawesome-photo-editor.md
PostHog集成
@capawesome/capacitor-posthog
references/capawesome-posthog.md
打印机
@capawesome-team/capacitor-printer
references/capawesome-printer.md
内购
@capawesome-team/capacitor-purchases
references/capawesome-purchases.md
RealtimeKit集成
@capawesome/capacitor-realtimekit
references/capawesome-realtimekit.md
屏幕方向
@capawesome/capacitor-screen-orientation
references/capawesome-screen-orientation.md
截图
@capawesome/capacitor-screenshot
references/capawesome-screenshot.md
安全偏好设置
@capawesome-team/capacitor-secure-preferences
references/capawesome-secure-preferences.md
分享目标
@capawesome-team/capacitor-share-target
references/capawesome-share-target.md
语音识别
@capawesome-team/capacitor-speech-recognition
references/capawesome-speech-recognition.md
语音合成
@capawesome-team/capacitor-speech-synthesis
references/capawesome-speech-synthesis.md
SQLite集成
@capawesome-team/capacitor-sqlite
references/capawesome-sqlite.md
Square移动支付
@capawesome/capacitor-square-mobile-payments
references/capawesome-square-mobile-payments.md
Superwall集成
@capawesome/capacitor-superwall
references/capawesome-superwall.md
手电筒
@capawesome/capacitor-torch
references/capawesome-torch.md
Wi-Fi管理
@capawesome-team/capacitor-wifi
references/capawesome-wifi.md
压缩解压
@capawesome-team/capacitor-zip
references/capawesome-zip.md

Capacitor Firebase Plugins

Capacitor Firebase插件

PluginPackageReference
Analytics
@capacitor-firebase/analytics
references/firebase-analytics.md
App
@capacitor-firebase/app
references/firebase-app.md
App Check
@capacitor-firebase/app-check
references/firebase-app-check.md
Authentication
@capacitor-firebase/authentication
references/firebase-authentication.md
Crashlytics
@capacitor-firebase/crashlytics
references/firebase-crashlytics.md
Firestore
@capacitor-firebase/firestore
references/firebase-firestore.md
Functions
@capacitor-firebase/functions
references/firebase-functions.md
Messaging
@capacitor-firebase/messaging
references/firebase-messaging.md
Performance
@capacitor-firebase/performance
references/firebase-performance.md
Remote Config
@capacitor-firebase/remote-config
references/firebase-remote-config.md
Storage
@capacitor-firebase/storage
references/firebase-storage.md
插件包名参考文件
分析
@capacitor-firebase/analytics
references/firebase-analytics.md
应用核心
@capacitor-firebase/app
references/firebase-app.md
应用校验
@capacitor-firebase/app-check
references/firebase-app-check.md
身份认证
@capacitor-firebase/authentication
references/firebase-authentication.md
崩溃分析
@capacitor-firebase/crashlytics
references/firebase-crashlytics.md
云Firestore
@capacitor-firebase/firestore
references/firebase-firestore.md
云函数
@capacitor-firebase/functions
references/firebase-functions.md
消息推送
@capacitor-firebase/messaging
references/firebase-messaging.md
性能监控
@capacitor-firebase/performance
references/firebase-performance.md
远程配置
@capacitor-firebase/remote-config
references/firebase-remote-config.md
云存储
@capacitor-firebase/storage
references/firebase-storage.md

Capacitor MLKit Plugins

Capacitor MLKit插件

PluginPackageReference
Barcode Scanning
@capacitor-mlkit/barcode-scanning
references/mlkit-barcode-scanning.md
Face Detection
@capacitor-mlkit/face-detection
references/mlkit-face-detection.md
Face Mesh Detection
@capacitor-mlkit/face-mesh-detection
references/mlkit-face-mesh-detection.md
Selfie Segmentation
@capacitor-mlkit/selfie-segmentation
references/mlkit-selfie-segmentation.md
Subject Segmentation
@capacitor-mlkit/subject-segmentation
references/mlkit-subject-segmentation.md
Translation
@capacitor-mlkit/translation
references/mlkit-translation.md
插件包名参考文件
条码扫描
@capacitor-mlkit/barcode-scanning
references/mlkit-barcode-scanning.md
人脸检测
@capacitor-mlkit/face-detection
references/mlkit-face-detection.md
人脸网格检测
@capacitor-mlkit/face-mesh-detection
references/mlkit-face-mesh-detection.md
自拍分割
@capacitor-mlkit/selfie-segmentation
references/mlkit-selfie-segmentation.md
主体分割
@capacitor-mlkit/subject-segmentation
references/mlkit-subject-segmentation.md
翻译
@capacitor-mlkit/translation
references/mlkit-translation.md

Error Handling

错误处理

  • Installation fails: Verify the package name is correct and the plugin version is compatible with the project's Capacitor version. Check
    @capacitor/core
    version in
    package.json
    .
  • npx cap sync
    fails
    : Ensure all native dependencies are installed. On iOS with CocoaPods, run
    cd ios/App && pod install
    . On Android, sync Gradle files.
  • Android build fails: Check that required Gradle variables are set in
    variables.gradle
    . Verify permissions are added to
    AndroidManifest.xml
    .
  • iOS build fails: Check that required
    Info.plist
    entries are present. Verify the deployment target meets the plugin's minimum requirement.
  • Plugin not found at runtime: Ensure
    npx cap sync
    was run after installation. For iOS, verify the dependency was installed (pod for CocoaPods, package for SPM). For Android, verify the Gradle sync completed.
  • Permission denied at runtime: Check that permissions are declared in platform config files AND requested at runtime via
    checkPermissions()
    /
    requestPermissions()
    where applicable.
  • 安装失败:验证包名是否正确,插件版本是否与项目的Capacitor版本兼容。检查
    package.json
    中的
    @capacitor/core
    版本。
  • npx cap sync
    失败
    :确保所有原生依赖已安装。对于使用CocoaPods的iOS项目,运行
    cd ios/App && pod install
    。对于Android项目,同步Gradle文件。
  • Android构建失败:检查
    variables.gradle
    中是否已设置所需的Gradle变量。验证权限是否已添加到
    AndroidManifest.xml
  • iOS构建失败:检查是否已添加所需的
    Info.plist
    条目。验证部署目标是否满足插件的最低要求。
  • 运行时未找到插件:确保安装后已运行
    npx cap sync
    。对于iOS,验证依赖是否已安装(CocoaPods对应pod,SPM对应包)。对于Android,验证Gradle同步已完成。
  • 运行时权限被拒绝:检查权限是否已在平台配置文件中声明,并且在运行时通过
    checkPermissions()
    /
    requestPermissions()
    请求(如适用)。