Closed yerenutku closed 1 week ago
Please make sure you use the valid Android Studio release version. Google releases its IDEs using different versioning, like 2024.2.1.5
.
You can find the full listing of available releases and matching IntelliJ IDEA here: https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
Oh man, thank you! I tried copying almost everything on that site but that field... now it worked! Although, I started getting this error (finally a new error <3)
org.gradle.api.GradleException: More than one IntelliJ Platform dependencies found.
And I had to remove create
function to make it work:
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
dependencies {
testImplementation(libs.junit)
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
intellijPlatform {
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion")) <--- This line had to go
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
androidStudio("2023.3.1.20")
bundledPlugin("org.jetbrains.android")
instrumentationTools()
pluginVerifier()
zipSigner()
testFramework(TestFrameworkType.Platform)
}
}
create()
uses a version that is defined in gradle.properties, changing the version code, that would match in the version list website did not work and I kept getting the same error. I think that is because, create()
sets a specific platform plugin version, and androidStudio()
probably sets a platform plugin as well to ensure both (android studio and intellij platform) versions are capable therefore they clash.
After removing, create()
line, I was able to add these lines into my plugin.xml
<depends>com.intellij.modules.androidstudio</depends>
<depends>org.jetbrains.android</depends>
Thank you very much for the help!
What happened?
Hi, There is a bug with the new plugin version that the template uses. The
androidStudio()
function does not work properly.I want to develop an Android Studio plugin, therefore I need to add an Android plugin into
gradle.build.kts
as follows in many libraries and guides on the internet (some of the official JetBrains pages also have this) do it as follows:With the new template, gradle functions look very different (Intellij Platform Plugin version is the main reason, new template uses 2.+). There is no
intellij {}
scope in the new template. Based on this document, we should do it as follows:Regardless of what version I put there, then gradle never finds the corresponding Andriod Studio and throws an error:
I spent a good day trying to add Android Studio dependency to my newly created template but did not succeed. I debugged and it seems like the
androidStudio()
function has a null for itsprovider
value. I tried many ways to set that but could not make it. I tried setting local Android Studio as localPath however those functions are also different with the new version and I could find nothing that would make it work.Is there a solution for setting up Android Plugins into our project with the new template?
Relevant log output or stack trace
Steps to reproduce
1) Follow the steps to create your own project via the template guide 2) Try to add Android dependencies into your project.
Gradle IntelliJ Plugin version
2.0.1
Gradle version
8.9
Operating System
macOS
Link to build, i.e. failing GitHub Action job
No response