Breaking changes in code
Plugin's success()
and error()
methods have been removed, use resolve()
and reject()
instead.
Some deprecated plugin definitions and methods such as registerWebPlugin
have been removed, check the Capacitor 3 plugins upgrade guide for more information.
Capacitor's helper properties platform
and isNative
have been removed, use getPlatform()
and isNativePlatform()
methods instead.
Android
BridgeFragment
class has been removed, if a plugin was using that class to present a Fragment
, they'll have to create their own version of it.
iOS
Add SPM support
Capacitor 6 added experimental SPM support, you can add support for your plugin following Converting existing plugins to SPM
Updating Capacitor to 7.0 in your plugin
Using @capacitor/plugin-migration-v6-to-v7
From the plugin folder, run npx @capacitor/plugin-migration-v6-to-v7@latest
and it will perform all the file changes automatically.
Updating the files manually
Updating package.json
Update @capacitor/cli
, @capacitor/core
, @capacitor/android
and @capacitor/ios
in devDependencies to ^7.0.0-rc.0
version.
Update @capacitor/core
in peerDependencies to >=7.0.0-rc.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.6.1'
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
}
Update targetSDK / compileSDK to 35 and minSDK to 23
# build.gradle
android {
- compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
defaultConfig {
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
...
}
}
Update gradle plugin to 8.7.2
dependencies {
- classpath 'com.android.tools.build:gradle:8.2.1'
+ classpath 'com.android.tools.build:gradle:8.7.2'
}
Update gradle wrapper to 8.11.1
# gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Update to Java 21
# build.gradle
compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
+ sourceCompatibility JavaVersion.VERSION_21
- targetCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_21
}
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.10'
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.25'
repositories {
Raise iOS Deployment Target to 14
Update your plugin's .podspec file
- s.ios.deployment_target = '13.0'
+ s.ios.deployment_target = '14.0'
SPM compatible plugins
Update Package.swift
file
- platforms: [.iOS(.v13)],
+ platforms: [.iOS(.v14)],
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 14.0. Repeat the same steps for any app Targets.
Then, open ios/Podfile
and update the iOS version to 14.0:
-platform :ios, '13.0'
+platform :ios, '14.0'