-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add v3 to v4 plugin migration page #123
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
While you can follow the manual steps below, check out [this tool](https://github.com/rdlabo-team/capacitor-plugin-to-v4) from community member [@rdlabo](https://twitter.com/rdlabo) that automatically updates a Capacitor 3 plugin to v4. | ||
::: | ||
|
||
## Android |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed this commit to figure out what changed. I may have missed something. if it's easier, maybe we just recommend the migration tool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you removing the updating to 3.x guide? I think it can still be helpful and we are keeping the older upgrade guides for capacitor, so I think we should keep the old upgrade guides for plugins too.
You have missed the podspec change, which is the most important one related to the iOS deployment target as the podspec is what's used when users install the plugin in their project
ionic-team/create-capacitor-plugin@03027bf#diff-dc8721a872ae0dcc9e412a0a0b13bc684f6b8de82abee362ce965cf6d216f2d4L14
That's true, definitely should keep those around. The PR makes it look like I deleted it entirely but I only removed from the current v4 Capacitor docs root level. Essentially it's replaced with the new v4 page (docs/updating/plugins/4-0). The 3.x guide still lives under
OK, updated the PR. see if it's correct now. |
This reverts commit 2fbb691.
I know the docs are still on the v3 version of the docs, but I think we should keep the plugin update to version 3 file on the main docs too as we are doing with the updating app docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a few more comments
also it's missing this java 11 change (some java 11 changes are mentioned, but not this) ionic-team/create-capacitor-plugin@03027bf#diff-51795f26cbdfdde24931f6d0f9d6f047f4617fc6a6cb850029cd78c8e0e9b90dR39-R40
|
||
### Update to Gradle 7 | ||
|
||
Adjust your Gradle project settings in `File > Project Structure > Project`. The Android Gradle Plugin Version should be 7.2.1 or later and the Gradle Version should be 7.4.2 or later. Apply these changes and run a gradle sync by clicking on the Elephant Icon in the top right of Android Studio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust your Gradle project settings in `File > Project Structure > Project`. The Android Gradle Plugin Version should be 7.2.1 or later and the Gradle Version should be 7.4.2 or later. Apply these changes and run a gradle sync by clicking on the Elephant Icon in the top right of Android Studio. | |
Adjust your Gradle project settings in `File > Project Structure > Project`. The Android Gradle Plugin Version should be 7.2.1 and the Gradle Version should be 7.4.2. Apply these changes and run a gradle sync by clicking on the Elephant Icon in the top right of Android Studio. |
Better not use "or later" as newer versions could cause issues, stick to the ones we used in all plugins and Capacitor itself.
|
||
Do the following to 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 13.0**. Repeat the same steps for any app **Targets**. | ||
|
||
Then, open `ios/App/Podfile` and update the iOS version to 13.0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, open `ios/App/Podfile` and update the iOS version to 13.0: | |
Then, open `ios/Podfile` and update the iOS version to 13.0: |
The guide is about plugins, there is no App folder in plugins, the Podfile is inside the ios folder
|
||
### Update Android Project Variables | ||
|
||
In your `build.gradle` file, update your values to the following new minimums: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In your `build.gradle` file, update your values to the following new minimums: | |
In your `android/build.gradle` file, update your values to the following new minimums: |
|
||
In your `build.gradle` file, update your values to the following new minimums: | ||
|
||
```groovy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this block is confusing, looks like you copied the changes from the variables.gradle file, but in plugins there is no variables.gradle file and the values are in different places and with a different format (using :
instead of =
)
So maybe instead of a code block use a list saying
minSdkVersion to 22
compileSdkVersion to 32
etc.
|
||
### Remove `jcenter()` from the Gradle files | ||
|
||
In previous Capacitor versions, `jcenter()` was required due to our Cordova compatibility layer being hosted on Jcenter. However, we are now using the latest Cordova Android version, hosted on Maven Central. With this, you may be able to remove `jcenter()` entirely from your `build.gradle` file. If you are using other native dependencies, make sure they aren't hosted on Jcenter before removing it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In previous Capacitor versions, `jcenter()` was required due to our Cordova compatibility layer being hosted on Jcenter. However, we are now using the latest Cordova Android version, hosted on Maven Central. With this, you may be able to remove `jcenter()` entirely from your `build.gradle` file. If you are using other native dependencies, make sure they aren't hosted on Jcenter before removing it! | |
In previous Capacitor versions, `jcenter()` was required due to our Cordova compatibility layer being hosted on Jcenter. However, we are now using the latest Cordova Android version, hosted on Maven Central. With this, you may be able to remove `jcenter()` entirely from your `android/build.gradle` file. If you are using other native dependencies, make sure they aren't hosted on Jcenter before removing it! |
No description provided.