JetBrains / intellij-platform-gradle-plugin

Gradle plugin for building plugins for IntelliJ-based IDEs
https://plugins.jetbrains.com/docs/intellij/gradle-prerequisites.html
Apache License 2.0
1.42k stars 270 forks source link

Can't find `performanceTesting.jar` when building against Android Studio 2024.2.1.2 #1738

Open pbreault opened 4 weeks ago

pbreault commented 4 weeks ago

What happened?

performanceTesting.jar is not bundled in android studio 2024.2.1.* This causes a resolution error in :compileKotlin.

Relevant log output or stack trace

Execution failed for task ':compileKotlin'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find /Users/pbreault/.gradle/caches/8.9/transforms/55d0ff1d6fc91e695986202ef9ca3343/transformed/android-studio-2024.2.1.2-mac_arm/plugins/performanceTesting/lib/performanceTesting.jar-242.20224.300.2421.12216002+167.jar (bundledModule:com.jetbrains.performancePlugin:242.20224.300.2421.12216002+167).
     Searched in the following locations:
         file:/Users/pbreault/.gradle/caches/8.9/transforms/55d0ff1d6fc91e695986202ef9ca3343/transformed/android-studio-2024.2.1.2-mac_arm/plugins/performanceTesting/lib/performanceTesting.jar

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

Steps to reproduce

1. build.gradle.kts

plugins {
    id("org.jetbrains.kotlin.jvm") version "1.9.24"
    id("org.jetbrains.intellij.platform") version "2.0.1"
}

repositories {
    mavenCentral()
    intellijPlatform {
        defaultRepositories()
    }
}

intellijPlatform {
    pluginConfiguration {
        name = "example"
        group = "com.example"
    }
    buildSearchableOptions.set(false)
    instrumentCode = true
}

java {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

tasks.runIde {
    jvmArgs = listOf("-Xmx4096m", "-XX:+UnlockDiagnosticVMOptions")
}

dependencies {
    intellijPlatform {
        bundledPlugin("org.jetbrains.android")
        instrumentationTools()
        androidStudio("2024.2.1.2")

    }

    testImplementation("junit:junit:4.13.2")
    testImplementation("org.mockito:mockito-core:4.7.0")
    testImplementation("com.google.truth:truth:1.4.4")
}

2. Need at least one Kotlin file to force :compileKotlin to run.

//  src/main/kotlin/com/example/main.kt
println("hello world")

3. Repro

gradle build

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

emertozd commented 4 weeks ago

I extracted that jar from IntelliJ IDEA (2024.2) and placed it in the directory that was causing the error. Until the bug is fixed, this workaround can be used.