Skip to main content
Version: v8

Updating Capacitor to 8.0 in your plugin

Using @capacitor/plugin-migration-v7-to-v8

From the plugin folder, run npx @capacitor/plugin-migration-v7-to-v8@latest and it will perform all the file changes automatically.

Updating the files manually

Updating npm dependencies

Updating Capacitor dependencies

Update @capacitor/cli, @capacitor/core, @capacitor/android and @capacitor/ios in devDependencies to ^8.0.0 version. Update @capacitor/core in peerDependencies to >=8.0.0 version.

Update Android Plugin Variables

In your build.gradle file, update the following package version minimums:

ext {
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
}

Update targetSDK / compileSDK to 36 and minSDK to 24

# build.gradle

android {
- compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
defaultConfig {
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
...
}
}

Update gradle plugin to 8.13.0

    dependencies {
- classpath 'com.android.tools.build:gradle:8.7.2'
+ classpath 'com.android.tools.build:gradle:8.13.0'
}

Update gradle wrapper to 8.14.3

# gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Update kotlin_version

If your plugin uses kotlin, update the default kotlin_version

# build.gradle
buildscript {
- ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.25'
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.2.20'
repositories {

Update google services plugin

# build.gradle

dependencies {
classpath 'com.android.tools.build:gradle:8.13.0'
- classpath 'com.google.gms:google-services:4.4.2'
+ classpath 'com.google.gms:google-services:4.4.4'

Raise iOS Deployment Target to 15

Update your plugin's .podspec file

-  s.ios.deployment_target = '14.0'
+ s.ios.deployment_target = '15.0'

SPM compatible plugins

Update Package.swift file

-    platforms: [.iOS(.v14)],
+ platforms: [.iOS(.v15)],

Plugins with old structure

Do the following for your Xcode project: select the Project within the project editor and open the Build Settings tab. Under the Deployment section, change iOS Deployment Target to iOS 15.0. Repeat the same steps for any app Targets.

Then, open ios/Podfile and update the iOS version to 15.0:

-platform :ios, '14.0'
+platform :ios, '15.0'

Update Capacitor SPM dependency

In SPM compatible plugins, update Package.swift file to use version 8.0.0.

    dependencies: [
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
],