How to replace deprecated Cell.verticalAlignment in 2023.1 and also support 2022.1 for Android Studio
Answered
Hi,
2023.1 deprecates two functions in the Kotlin UI, namely:
`Cell.verticalAlignment` and `Cell.horizontalAlignment`.
There is a `Cell.align` replacement function, however it is not present in 2022.1 which I want to support due to slow Android Studio release cycles.
Is there a way to fix these usages and also support IJ 2022.1 ?
Currently the plugin verifier hinders me to publish new releases due to these issues: https://plugins.jetbrains.com/plugin/10761-detekt/versions/beta
Thanks!
Please sign in to leave a comment.
Hi Artur,
You can consider separate branches for releases compatible with 2023.1 and 2022.1, but I think it would be overkill for such a plugin verifier issue.
Cell.verticalAlignmentandCell.horizontalAlignmentmethods are scheduled for removal but are still available.I would ignore this issue and fix it when it is available in Android Studio.
Hi Karol,
thanks for the answer. Yes, my plugin was accepted to the marketplace with this warning.
Is the deprecation process of IntelliJ API somehow related to the Android Studio release?
It could still happen that Jetbrains decides to remove these Kotlin DSL function in 2023.2 but Android Studio will need 1-2 years to catch up and then I have to split my plugin releases.
Thanks,
Artur
Hi Artur,
The deprecation process is not Android Studio aware. We monitor the usage of deprecated APIs in plugins and avoid removing them if they are used. It doesn't mean that they will be kept forever, so plugin vendors should migrate to newer APIs whenever they can.
I wouldn't worry until the actual incompatibility appears. In this case, you will need two releases targeting old and new APIs.