Skip to content
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

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

Closed
pbreault opened this issue Aug 15, 2024 · 12 comments
Assignees
Labels
Milestone

Comments

@pbreault
Copy link

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

@pbreault pbreault added the bug label Aug 15, 2024
@emertozd
Copy link

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.

@kadorisio-hood
Copy link

This issue is blocking development for plugins built against 2024.2.x.

Was the performanceTesting.jar dependency accidentally included in the AS bundle manifest? It seems to be an Intellij based plugin.

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.

I was able to use this workaround to get a new version published, but it's unstable and continually fails during development. It's not scalable across teams.

@dennisbordet
Copy link

dennisbordet commented Oct 14, 2024

I took this one from the repository as a workaround. I renamed it "performanceTesting.jar" and moved it in the folder mentionned in the example

@qbalsdon
Copy link

I have tried writing an awful workaround for my deployment pipeline, but it doesn't work... Could really use some help!

      - name: Missing performanceTesting jar hack fix
        run: |
          echo "see https://github.com/JetBrains/intellij-platform-gradle-plugin/issues/1738"
          FOLDER=/home/runner/.gradle/caches/transforms-3/e773a64bc76e36769f59d43df2c66fa6/transformed/android-studio-2024.2.1.10-linux/plugins                 
          mkdir -p ${FOLDER}/performanceTesting
          mkdir -p ${FOLDER}/performanceTesting/lib
          FOLDER=${FOLDER}/performanceTesting/lib
          
          FILE=performance-testing-242.23339.19.jar
          URL=https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/performanceTesting/performance-testing/242.23339.19/${FILE}
          wget -O ${FOLDER}/${FILE} ${URL}
          ls -l ${FOLDER}

@dennisbordet
Copy link

dennisbordet commented Oct 30, 2024

I have tried writing an awful workaround for my deployment pipeline, but it doesn't work... Could really use some help!

      - name: Missing performanceTesting jar hack fix
        run: |
          echo "see https://github.com/JetBrains/intellij-platform-gradle-plugin/issues/1738"
          FOLDER=/home/runner/.gradle/caches/transforms-3/e773a64bc76e36769f59d43df2c66fa6/transformed/android-studio-2024.2.1.10-linux/plugins                 
          mkdir -p ${FOLDER}/performanceTesting
          mkdir -p ${FOLDER}/performanceTesting/lib
          FOLDER=${FOLDER}/performanceTesting/lib
          
          FILE=performance-testing-242.23339.19.jar
          URL=https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/performanceTesting/performance-testing/242.23339.19/${FILE}
          wget -O ${FOLDER}/${FILE} ${URL}
          ls -l ${FOLDER}

Does this workaround work on your laptop @qbalsdon ?
You need to rename the downloaded file to "performanceTesting.jar"

@VDenis
Copy link

VDenis commented Oct 30, 2024

I took this one from the repository as a workaround. I renamed it "performanceTesting.jar" and moved it in the folder mentionned in the example

I try this solution and get error after Run plugin with exception

"performanceTesting.jar' contains invalid plugin descriptor".
+"WARN: Cannot load performanceTesting.jar, Cannot resolve intellij.performanceTesting.remoteDriver.xml"

@Alexs784
Copy link

I try this solution and get error after Run plugin with exception

"performanceTesting.jar' contains invalid plugin descriptor". +"WARN: Cannot load performanceTesting.jar, Cannot resolve intellij.performanceTesting.remoteDriver.xml"

I had the same. If you look at the repository link posted by @dennisbordet , you will notice there are multiple versions of the performance-Testing.jar file. You need to download the one corresponding to your target build.
You can find the necessary build number by looking at this table and matching your Android Studio target version.

@qbalsdon
Copy link

qbalsdon commented Nov 6, 2024

@dennisbordet no, lol - nothing works - that solution was an awful attempt for my github actions, and it definitely doesn't work

@hsz hsz added this to the next milestone Nov 6, 2024
@hsz hsz self-assigned this Nov 6, 2024
@gharrma
Copy link
Contributor

gharrma commented Nov 12, 2024

Just FYI, on the Android Studio side, we plan to bundle the Performance Testing plugin starting in Android Studio M Canary 2 (coming soon).

@hsz
Copy link
Member

hsz commented Nov 18, 2024

Unfortunately, the performancePlugin bundled module is listed in the Android Studio's product-info.json, and points to the file that doesn't exist.
This bundled module comes to the org.jetbrains.android bundled plugin as a transitive dependency.
Fortunately, it is possible to exclude such a transitive dependency with:

import org.jetbrains.intellij.platform.gradle.Constants.Configurations

configurations {
    named(Configurations.INTELLIJ_PLATFORM_BUNDLED_MODULES) {
        exclude(Configurations.Dependencies.BUNDLED_MODULE_GROUP, "com.jetbrains.performancePlugin")
    }
}

Note that this is just a workaround; the proper fix will be included in the upcoming IntelliJ Platform Gradle Plugin release.

hsz added a commit that referenced this issue Nov 18, 2024
@hsz hsz closed this as completed Nov 19, 2024
Undin added a commit to JetBrains/educational-plugin that referenced this issue Nov 19, 2024
…hen using Android Studio dependency

Android Studio 2024.2 declares that it has `com.jetbrains.performancePlugin` (and it's a dependency of Android plugin) but it doesn't contain it. It leads to configuration errors.
So, these changes temporarily exclude it from the dependency list to avoid the failure.

See JetBrains/intellij-platform-gradle-plugin#1738
Undin added a commit to JetBrains/educational-plugin that referenced this issue Nov 19, 2024
…hen using Android Studio dependency

Android Studio 2024.2 declares that it has `com.jetbrains.performancePlugin` (and it's a dependency of Android plugin) but it doesn't contain it. It leads to configuration errors.
So, these changes temporarily exclude it from the dependency list to avoid the failure.

See JetBrains/intellij-platform-gradle-plugin#1738
@joshfriend
Copy link

it is possible to exclude such a transitive dependency

Very helpful! Here's a groovy syntax version:

import org.jetbrains.intellij.platform.gradle.Constants
configurations.configureEach {
  if (it.name == Constants.Configurations.INTELLIJ_PLATFORM_BUNDLED_MODULES) {
    exclude group: Constants.Configurations.Dependencies.BUNDLED_MODULE_GROUP, module: "com.jetbrains.performancePlugin"
  }
}

Undin added a commit to JetBrains/educational-plugin that referenced this issue Nov 21, 2024
…hen using Android Studio dependency

Android Studio 2024.2 declares that it has `com.jetbrains.performancePlugin` (and it's a dependency of Android plugin) but it doesn't contain it. It leads to configuration errors.
So, these changes temporarily exclude it from the dependency list to avoid the failure.

See JetBrains/intellij-platform-gradle-plugin#1738
@technoir42
Copy link

This is still an issue, see #1843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests