Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-6.8.1-all.zip' - eclipse

I am trying to manually update a minecraft mod/update a deprecated mod, and I have changed the build.gradle to match the Forge version I need, and it had an original error that I resolved which was it was using an outdated gradle build I think. The original error is this
Description Resource Path Location Type
Could not fetch model of type 'EclipseProject' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-2.14-all.zip'.
But I resolved that by changing the gradle wrapper properties to the version of gradle the forge version MDK has, but now it is giving me this new error. I have no idea how to fix this error and am looking for help.

Related

in_app_update:compileDebugKotlin error in Flutter build when debugging

I had this issue when I try to setup my project on my new pc.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':in_app_update:compileDebugKotlin'.
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
I tried to find the solution here and some says its because of the kotlin version
I need some pointers out here, thanks in advance!
Without more context is hard to say, but when compilation fails the errors are usually listed somewhere else (before the failure). Read the whole output of Gradle and look for lines starting with e:.
Looking at your first image which says:
> Task :app:kaptGenerateStubsDebugKotlin
'compileDebugJavaWithJavac' task (current target is 1.7) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
Depending on your Kotlin version and gradle.properties contents the JVM incompatibility might be a warning or an error. Since it doesn't say "it will become an error", suggests that the flag is on error.
This is the part I'm missing:
By default will become an error since Gradle 8.0+! Read more: https://kotl.in/gradle/jvm/target-validation
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
So you have a few options. Set up your PATH / JAVA_HOME to point to Java 7 installation, I think you have Java 8 now, but the project expects 7 (or the other way around). Without seeing targetCompatibility / jvmTarget DSL, it's hard to tell.
Anyway, just recently we reported a similar issue to Kotlin and they provided a very clean solution: https://youtrack.jetbrains.com/issue/KTIJ-24311/#focus=Comments-27-6798448.0-0
build.gradle (for each module):
kotlin {
jvmToolchain(7)
}
This is what the documentation also suggests.
If you can't make it work by juggling Java versions, you can disable the warning and maybe that will make it work:
gradle.properties:
kotlin.jvm.target.validation.mode=ignore
This is documented here. Please understand what you're turning off and that it'll break things now or in the future if you do.

intelliJ multiple scala-library*.jar file

I tried to run scala app in IJ community version 2018.3.6, and ran into this error:
Error:scalac: Multiple 'scala-library*.jar' files (scala-library-2.12.8.jar, scala-library-2.12.8.jar) in Scala compiler classpath in Scala SDK sbt: org.scala-lang:scala-library:2.12.8:jar
and I checked hte .idea/libraries folder saw:
sbt__org_scala_lang_scala_library_2_11_8.jar.xml
sbt__org_scala_lang_scala_library_2_12_8.jar.xml
after I delete sbt__org_scala_lang_scala_library_2_11_8.jar.xml still got the same error, then i deleted all 2.11.8 scala*.files still got hte same error
I also tried to open the same project in IJ community version 2019.2.4, it complained:
Cannot determine module type ("SBT_MODULE") for the following module:
there is no 'sbt' tool listed in Preference -> Build, Execution, Deployment -> Build Tools
anyone know how to get it work?
## FIX
i ended up to uninstall and reinstall Scala plugin in IJ 2019.2.4 to get it working again.

Build Failure of Apache Beam 2.6.0-SNAPSHOT

I am Facing Issue While Building master Node of Apache beam 2.6.0-SNAPSHOT and Getting Error :
Failed to execute goal com.igormaznitsa:mvn-golang-wrapper:2.1.7:build (go-build-linux-amd64)
Can't find generated target file : C:\Users\KishanK\Desktop\2.5.0\Updated\beam\sdks\go\target\linux_amd64\beamctl -> [Help 1]
I am Facing problem from Last Few Weeks Build Always get Failed on Go SDK.
Thanks for reporting the issue. I also see the problem on my machine and opened a bug: https://issues.apache.org/jira/browse/BEAM-4724
Note that Beam has migrated its build system from Maven to Gradle and Maven support is in the process of being removed. The error happens with Maven only and why it seems to have gone unnoticed. The simplest path forward is to build with Gradle instead, i.e., "./gradlew build".
Henning

Eclipse Gradle Plugin 'could not fetch model of type'

I am running Eclipse Luna on OS X with Gradle IDE 3.6.1 and anytime I try to select a project from the gradle tasks panel I get the following error:
org.eclipse.osgi.internal.framework.EquinoxConfiguration$1
Could not fetch model of type 'EclipseProject' using Gradle distribution
'https://services.gradle.org/distributions/gradle-2.0-bin.zip'.
Has anyone else run into this error? I can get to the URL specified to download the file myself. So, network connectivity shouldn't be the problem.
The problem is for the java version configured by default on the IDE (Eclipse or Spring Tool Suite). The error is the following:
To fix it, you can set the Java version supported by the Gradle version in Configure Workspace Setting option.
Finally, you can refresh your project o continue with your creation. Later all will be perfect.
I had the same error in Eclipse Neon (version numbers were different, but otherwise same error). It looks like several different things can cause this error, but for me it was an incorrect property in [MyProject]/.settings/org.eclipse.buildship.core.prefs.
I had
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
but it needed to be
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(2.13))
2.13 should be replaced with whatever version number output you get from gradle -version.
Coming back to add this:
It turns out, the actual root problem was an incompatibility between Gradle versions. My build.gradle file worked fine with an old version of Gradle, but uses things that were deprecated and removed in later versions.
Solution is to click Finish immediately in the wizard instead of Next, and then fix the issues in the build.gradle.
Bad reference in config.
Overwrite configuration:
Project -> Properties -> Gradle -> Override workspace settings ->
Specific Gradle version -> 4.x
You need to update Gradle
Goto:
Select 'Help > About Eclipse' (on Macs this is 'Eclipse > About Eclipse').
Click the 'Installation Details' button to display the installation details dialog. Look in the 'Installed Software' tab to see all the installed plugins.
Search for Gradle(Eclipse Plug-ins for Gradle) and Update.
It might take some time for first time after that.
Reason why it happens, cause new version of gradle is available to download. Once you download new version of gradle, your error will go away.
http://gradle.org/downloads
I had the same error message using Eclipse 4.5
In my case the build file was having a error and I had to modify this line
eclipse.classpath {
plusConfigurations += configurations.providedCompile
}
into this
eclipse.classpath {
plusConfigurations += [configurations.providedCompile]
}
After that everything worked again.
I met the same problem, somebody suggested that the gradle project may be build by a old version.
I solve the problem by the following step:
modify the configuration in Eclipse, perfrence ->gradle ->gradle distribution . point it to an older version.
delete the file in ./gradle/wrapper
reload the program
In my case, I forgot to put ending apostrophe ' for a value
I ran into a similar issue recently - even blowing away the project and repulling a fresh copy from git didn't fix it. I realized it wasn't specific to the project when I reproduced it outside of Eclipse:
$ ./gradlew tasks
FAILURE: Build failed with an exception.
* What went wrong:
Expecting a stack map frame
Exception Details:
Location:
build_euvk0e0guiuwrf8fgn8svi2fy.run()Ljava/lang/Object; #16: aconst_null
Reason:
Error exists in the bytecode
Bytecode:
0x0000000: 2abb 0022 592a 2ab7 0025 ba00 3300 00b0
0x0000010: 01b0
What did fix it was removing the gradle cache:
$ rm -r ~/.gradle/caches
$ ./gradlew tasks
Somehow the version of gradle there had become corrupted (possibly related to Eclipse groovy plugin - I had this issue regularly until uninstalling it), and blowing it away forced it to get a fresh copy.
Hopefully this answer helps someone else avoid pulling out their hair.
I had a very similar issue and removing the following from my build.gradle fixed it. The same bit of config works in all other Gradle projects I have but for some reason not this one...
allprojects {
...
apply plugin: 'eclipse-wtp'
...
// remove this eclipse config to make the error go away
eclipse {
classpath { defaultOutputDir = file('build-eclipse') }
}
...
}
Open the CMD and enter there gradle --gui, change the settings of the gradle gui in the register Setup to Stack trace Output: Full Stack trace [-S] and the log level to info. Then change the current directory to the directory your build.gradle file is located and then go to the first register and let process the gui this files.
An error message should be displayed. There you find out what is wrong with your build.gradle file. In my case there was a folder missing and this causes this error.
This error can also be caused by a syntax error in the previous line of build.gradle. If so, the error has nothing to do with the Gradle or Eclipse version you are running. See this question
In my case i changed the Gradle version from 4.7.rc2 to4.6 and then it started to work.
I am on eclipse Oxygen (4.7.2), I was getting similar exception while importing the project and this worked for me:
While importing on windows Import Options
Click Configure Workspace Setting (which will take to preference window)
Select Local Installation directory (for me 'graddle wrapper' was selected)
apply, close and continue import
Below is the error I was getting
Loading Gradle project preview failed due to an error in the referenced Gradle build.
Could not fetch model of type 'GradleBuild' using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.5-bin.zip'.
_BuildScript_
org.gradle.tooling.BuildException: Could not fetch model of type 'GradleBuild' using Gradle distribution 'https://services.gradle.org/distributions/gradle-3.5-bin.zip'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at Caused by: java.lang.ClassNotFoundException: _BuildScript_
at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler$ScriptClassLoader.loadClass(DefaultScriptCompilationHandler.java:386)
... 77 more
None of the solutions worked for me and I'm having the same errors on STS 4 with eclipse Version: 2.2.600.v20190605-1800. My steps were:
Delete the project from my workspace
./gradlew cleanEclipseWtp cleanEclipse eclipseWtp eclipse
Import the project as an existing eclipse project (not an existing gradle import)
That worked!
Deleting .gradle folder from the project resolved my problem.
I got this error with Eclipse 2021-06, Java 1.8.0, gradle 4.4.
I tried deleting gradle wrapper binary folder, predefining gradle version, etc.
The thing that helped was just specifying gradle home directory and java home directory after selecting overriding workspace configuration.
Eclipse 4.4.1 broke Gradle Eclipse support with non-string values in system properties.This is fixed in the latest Gradle for the 3.6.2 release. Update your Gradle form this update-site: http://dist.springsource.com/snapshot/TOOLS/gradle/nightly

Gradle project.sourceSets.main.runtimeClasspath always blank

I'm writing a Gradle plugin to generate Java code from WSDL. Problem is, my task does not find the Java class I'm trying to execute and blows up at runtime with a ClassNotFoundException even though the necessary jar is listed as a compile dependency. I'm using project.sourceSets.main.runtimeClasspath but have tried compileClasspath, adding a build script section to the build file, using configurations.runtime, all to no avail. Note that my project has no Java src code, just Groovy.
Any ideas? The task, a unit test and the build file can be found here:
https://gist.github.com/abhijitsarkar/8432347
c.f.: cross posted on the Gradle forum
It turns out that because my plugin uses project.sourceSets.main.runtimeClasspath, the client needs to declare the dependencies with runtime scope. It is not enough to have the dependencies declared in the plugin project only.