Chutzpah throws exception in TFS Build: 'executor://chutzpah-js/': Method not found: 'System.String .. get_SolutionDirectory()' - chutzpah

This is the exception:
An exception occurred while invoking executor 'executor://chutzpah-js/': Method not found: 'System.String Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter.IRunContext.get_SolutionDirectory()'
Everything else is fine and all unit tests are reported succeeded when the build is complete => the build should be succeeded
But due to this exception, the build is considered partially succeeded which is very confusing.
I have been searching the internet, but still cannot find an answer. Please help me, thanks.

This looks to be an issue when you deploy a VSIX package that depends on VS2013 version of IRunContext and try to run it in VS2012. This particular property is not available in the older version and you get an exception.

Related

An unexpected error occurred while launching the test runtime (return code 1)

I have a Java project and there exists a Testing job in Jenkins, and it worked fine with all the required testcases. From recent times it shows a sporadic failure as mentioned below:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:1.6.0:test (default-test) on project MyProjectName: An unexpected error occurred while launching the test runtime (return code 1).
We could see there is no recent changes done related to the plugin, and not pretty sure like why this issue happens. can someone provide inputs to resolve the same ? Thank you !

Can't upgrade to gradle 6.6 because of "prefix string too short"

I'm trying to upgrade an existing project from gradle 6.5.1 to 6.6.
But when I build, it fails with an error:
Successfully started process 'Gradle build daemon'
An attempt to start the daemon took 1.116 secs.
The client will now receive all logging from the daemon (pid: 122). The daemon log file: /home/****/.gradle/daemon/6.6/daemon-122.out.log
Starting build in new daemon [memory: 519.0 MB]
Using 1 worker leases.
Starting Build
Compiling initialization script '/home/****/agent/workspace/Enrich_build_PR-41#tmp/artifactory/init-artifactory449129576487257952gradle' using SubsetScriptTransformer.
FAILURE: Build failed with an exception.
* What went wrong:
Failed to create Jar file /home/****/.gradle/caches/jars-8/8535adf040d7c5fdb7fd6bc28bb0ef3f/ok.
> Prefix string too short
Running with --debug, the only thing that looks relevant is:
020-10-05T16:38:54.631+0000 [DEBUG] [org.gradle.internal.component.model.LoggingAttributeMatchingExplanationBuilder] Selected match ok from candidates [ok] for {org.gradle.dependency.bundling=external, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
Which seems like an internal gradle issue. How can I fix or avoid this error?
(I also tried 6.6.1 and have the same problem)
It happens when I run "./gradlew help" as well, so it shouldn't be related to my build config.
The stacktrace looks like:
* Exception is:
org.gradle.api.GradleException: Failed to create Jar file /home/****/.gradle/caches/jars-8/8535adf040d7c5fdb7fd6bc28bb0ef3f/ok.
at org.gradle.internal.classpath.ClasspathBuilder.jar(ClasspathBuilder.java:47)
at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.transform(InstrumentingClasspathFileTransformer.java:76)
at org.gradle.internal.classpath.InstrumentingClasspathFileTransformer.transform(InstrumentingClasspathFileTransformer.java:70)
at org.gradle.internal.classpath.DefaultCachedClasspathTransformer$TransformFile.lambda$schedule$0(DefaultCachedClasspathTransformer.java:261)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: java.lang.IllegalArgumentException: Prefix string too short
at org.gradle.internal.classpath.ClasspathBuilder.buildJar(ClasspathBuilder.java:53)
at org.gradle.internal.classpath.ClasspathBuilder.jar(ClasspathBuilder.java:45)
... 6 more
Your issue seems to be related to artifactory plugin
Check https://github.com/jfrog/jenkins-artifactory-plugin/issues/349
Quick Fix
Recommend to downgrade to Gradle 6.5 to resolve the issue.
Further Details / Possible Cause
While I don't know the root cause of why this happens, I get the same 'Prefix string too short' error, in Gradle 6.6.1.
And in particular, this is my exact error message, from a Mac:
Failed to create Jar file /Users/****/.gradle/caches/jars-8/8535adf040d7c5fdb7fd6bc28bb0ef3f/ok.
Since the 'prefix' error came from Java, I looked at my Java install thinking that might be the problem. In my case Java was many versions behind, so I upgraded to 8u261 however that didn't seem to change anything.
For how it starts in our case:
User kicks off Jenkins job for Gradle
Jenkins job fails specifically for being unable to create the file in the cache directory. And the number actually is the same each time for the cache too; it's always '.gradle/caches/jars-8/8535adf040d7c5fdb7fd6bc28bb0ef3f/ok' and not a different number. So it's almost like that is statically set from somewhere.
So focusing on that error, I came across this similar-ish prefix error, for a Java issue. While this doesn't fully answer the issue we see, it does help explain why it could be a 'legitimate' error as it thinks the file name is less than 3 characters.
https://stackoverflow.com/a/48806741/14403001
So it feels like it's interpreting the end of that string as being the file name. Namely it might think that ok at the end of the path is actually a filename, and being less than 3 characters it sends the 'Prefix string too short' error. Keep in mind this is speculation and I don't know if this is actually the cause or not.
We happened to have another Mac that was running Gradle 6.5 that was working fine with the exact same Jenkins job. So we downgraded from Gradle 6.6.1 to 6.5 to match the other and are back working like before.
Since we used Mac, Brew didn't actually have an older version to roll back to. So I was forced to uninstall gradle via brew, then follow the steps below to install and point to an older version of Gradle.
Hoping it's easier for you via yum/apt to downgrade than it was for myself.
https://gradle.org/install/#manually

Android resource compilation failed - resource file not found

I'm trying to assemble an Android app in Bamboo server, but I'm getting this error when the assemble comand run. Note: It works perfectly in local.
Command running:
gradlew assembleDebug
And the error I get:
Caused by: org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\aa6199e981580f79dc21c6ea06a3575f\res\drawable-mdpi-v4\quantum_ic_skip_next_white_24.png: error: file not found.
I've checked for the resource and its use, but it's not from my project code. It belongs to an external library: play-services-cast-framework
I've been also checking other similar post, but the error can be caused for many resources reasons, so I've not found a solution.
Some solutions suggest that is a problem at some gradle plugin version, but I'm already using version 3.3.1
Any help or clue?
Thanks!

Issue evaluating legacy Gradle project `org/gradle/listener/ActionBroadcast`

When working on a legacy project, I mysteriously started getting the following error message:
A problem occurred evaluating project ':gateway'.
> org/gradle/listener/ActionBroadcast
This error message started occurring when I ran the command gradle clean build. Why am I getting this error message all of a sudden? Note that unlike other SO questions dealing with this error message, my problem should have nothing to do with a Sonarqube upgrade, as the project doesn't use Sonarqube.
The issue turned out to be that my project required Gradle 2.14, but I had accidentally switched my command prompt to Gradle 4.8. When I switched back to Gradle 2.14, this error message ceased.

Can't generate the APK

The App works perfectly in debug variant but when I change it to release variant the build fails and it gives me this error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details, and also on my java classes (setContentView(R.layout.activity_main)) the R tells me it can't resolve symbol 'R'.
This only happens when I change the build variant to release to finish the app.
Thank you in advance!

Resources