Gradle robolectric project works on OSX computer but not on Linux - linux

I'm using the same version of Gradle, 1.7 jdk thus not exactly the same version.
The main complain of the testing is :
java.lang.NoClassDefFoundError:
org/apache/maven/artifact/ant/DependenciesTask Caused by:
java.lang.ClassNotFoundException:
org.apache.maven.artifact.ant.DependenciesTask
I've tried to clean gradle cache in order to re download all dependencies.
Also i've tried to clean the project.
This didn't work.
What variables can affect the execution of a gradle test ?
To me there is:
Gradle itself
Java version of the sdk
Internet connections problems
What else can be interfering ? Are plugin versions platform dependant ?
Executing task ':robolectric-tests:test' (up-to-date check took 0.432 secs) due to:
Output file /home/ec2-user/repositories/MyProject/robolectric-tests/build/test-results has changed.
Output file /home/ec2-user/repositories/MyProject/robolectric-tests/build/reports/tests has changed.
Output file /home/ec2-user/repositories/MyProject/robolectric-tests/build/test-results/binary/test has changed.
Starting process 'Gradle Test Executor 1'. Working directory: /home/ec2-user/repositories/MyProject/robolectric-tests Command: /usr/java/jdk1.7.0_72/bin/java -Djava.security.manager=jarjar.org.gradle.process.internal.child.BootstrapSecurityManager -Dfile.encoding=UTF-8 -Duser.country=ES -Duser.language=ca -Duser.variant -ea -cp /home/ec2-user/.gradle/caches/2.3/workerMain/gradle-worker.jar jarjar.org.gradle.process.internal.launcher.GradleWorkerMain 'Gradle Test Executor 1'
Successfully started process 'Gradle Test Executor 1'
Gradle Test Executor 1 started executing tests.
Gradle Test Executor 1 finished executing tests.
com.tubtale.MyProject.robolectrictests.tests.RobTMyAndroidClassTest > testWhenActivityCreatedHelloTextViewIsVisible2 FAILED
java.lang.NoClassDefFoundError: org/apache/maven/artifact/ant/DependenciesTask
Caused by:
java.lang.ClassNotFoundException: org.apache.maven.artifact.ant.DependenciesTask
com.tubtale.MyProject.robolectrictests.tests.RobTMyAndroidClassTest > testWhenActivityCreatedHelloTextViewIsVisible FAILED
java.lang.NoClassDefFoundError: org/apache/maven/artifact/ant/DependenciesTask
2 tests completed, 2 failed
Finished generating test XML results (0.217 secs) into: /home/ec2-user/repositories/MyProject/robolectric-tests/build/test-results
Generating HTML test report...
Finished generating test html results (0.11 secs) into: /home/ec2-user/repositories/MyProject/robolectric-tests/build/reports/tests
:robolectric-tests:test FAILED
:robolectric-tests:test (Thread[main,5,main]) completed. Took 4.005 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':robolectric-tests:test'.
> There were failing tests. See the report at: file:///home/ec2-user/repositories/MyProject/robolectric-tests/build/reports/tests/index.html
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':robolectric-tests:test'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:306)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:169)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: org.gradle.api.GradleException: There were failing tests. See the report at: file:///home/ec2-user/repositories/MyProject/robolectric-tests/build/reports/tests/index.html
at org.gradle.api.tasks.testing.Test.handleTestFailures(Test.java:1118)
at org.gradle.api.tasks.testing.Test.executeTests(Test.java:549)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 44 more
BUILD FAILED

I also ran into this issue on Linux but not OSX. I found a work-around by adding
org.apache.maven:maven-ant-tasks:2.1.3
to my 'testCompile' dependencies.
dependencies {
repositories {
mavenCentral()
}
testCompile 'junit:junit:4.12'
testCompile 'org.apache.maven:maven-ant-tasks:2.1.3'
testCompile 'org.robolectric:robolectric:2.4'
testCompile 'org.mockito:mockito-all:1.9.5'
}
I don't know why maven-ant-tasks isn't getting fetched on linux. It appears to be a valid dependency of robolectric.

The selected answer is correct, and also applies when upgrading Gradle from 2.2.1 to 2.3 on OSX. If you don't add the dependency for testCompile 'org.apache.maven:maven-ant-tasks:2.1.3' then Robolectric tests will fail when the Gradle version is 2.3.
Also noteworthy is that I have a separate module for my Robolectric tests, so I added the new dependency to the build.gradle file in my Robolectric module, NOT my Android app module.
Just got a new Mac, so my old Mac & new Mac are side by side, while I configure the new one. I used Homebrew to build up my new Mac, and wasn't aware that Gradle 2.3 had just been released... That's why the Robolectric tests worked on my old Mac (with Gradle 2.2.1) but not on my new Mac (with Gradle 2.3).

Related

How to solve this Error : Gradle task assembleDebug failed with exit code 1

I installed Android Studio 4.1 and installed all of SDK and JDK 8 and etc.
When I want to run this flutter run in my project, I see this error:
C:\Users\Farshad\Desktop\myapp>flutter run
Launching lib\main.dart on Nokia 6 1 in debug mode...
Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Request blocked by Privoxy"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2152)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2739)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2651)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1830)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 17.9s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Request blocked by Privoxy"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2152)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2739)
at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2651)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1830)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 8.9s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
if you are from iran and cuba or syria or other some other countries
this error will be showing
because of filtering, i think android studio forbade those countries
you can use vpn and try again please tell me the result

Why is there an "UnknownHostException" in my first flutter project?

So I trying to make an app in Flutter SDK and downloaded its plugin in android studio and its SDK from the official website but it is showing an error in the first project I run I didn't write a single piece of code. I don't know why is this error coming up.
Running Gradle task 'assembleDebug'...
Exception in thread "main" java.net.UnknownHostException: services.gradle.org
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Finished with error: Gradle task assembleDebug failed with exit code 1
For the record the same error occurred for me. Not sure how it happened but the issue had to do with incorrect lines in "build.gradle".
Project-level build.gradle should have
classpath 'com.google.gms:google-services:4.3.5'
App-level build.gradle should have
apply plugin: 'com.google.gms.google-services'
Mine were changed to different domains. I suspect it was VS Code modifying them as i was jumping between VS Code and Android Studio.

Upgraded AndroidStudio to 3.4.1 and gradle problems

I have upgraded an Android Project from 3.2 to 3.4.1 and now I have gradle Problems.
The only indication is the bar at the top
and a message in the Event Log.
Gradle sync failed: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue#34e0424
Current thread: Thread[ApplicationImpl pooled thread 19,4,Idea Thread Group] 388194366
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 847161915 (1 s 526 ms)
I have cleaned rebuilt project.
Clicking on Open Build View -> nothing happens.
Log File contains:
INFO - e.project.sync.GradleSyncState - Finished source generation of project 'Chronica'.
2019-05-26 10:04:57,336 [thread 126] INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 26 Platform' (C:\Users\andreas\AppData\Local\Android\Sdk) to module 'LVLLibrary'
2019-05-26 10:04:57,340 [thread 126] INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 28 Platform' (C:\Users\andreas\AppData\Local\Android\Sdk) to module 'app'
2019-05-26 10:04:57,425 [thread 126] INFO - e.project.sync.GradleSyncState - Gradle sync failed: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue#34e0424
Current thread: Thread[ApplicationImpl pooled thread 126,4,Idea Thread Group] 812028699
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 847161915 (852 ms)
2019-05-26 10:04:57,425 [thread 126] WARN - ject.sync.ng.SyncResultHandler - Gradle sync failed
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue#34e0424
Current thread: Thread[ApplicationImpl pooled thread 126,4,Idea Thread Group] 812028699
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 847161915
at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1133)
at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1122)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:289)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:282)
at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.tryStartReloadWithProgress(EncodingProjectManagerImpl.java:361)
at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.reloadAllFilesUnder(EncodingProjectManagerImpl.java:366)
at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.setEncoding(EncodingProjectManagerImpl.java:180)
at com.intellij.openapi.vfs.encoding.EncodingProjectManagerImpl.setDefaultCharsetName(EncodingProjectManagerImpl.java:408)
at com.android.tools.idea.gradle.project.sync.validation.android.EncodingValidationStrategy.fixAndReportFoundIssues(EncodingValidationStrategy.java:83)
at com.android.tools.idea.gradle.project.sync.validation.android.AndroidModuleValidator$AndroidModuleValidatorImpl.fixAndReportFoundIssues(AndroidModuleValidator.java:63)
at com.android.tools.idea.gradle.project.sync.ng.AndroidModuleProcessor.processAndroidModels(AndroidModuleProcessor.java:63)
at com.android.tools.idea.gradle.project.sync.ng.SyncProjectModelsSetup.setUpModules(SyncProjectModelsSetup.java:143)
at com.android.tools.idea.gradle.project.sync.ng.ProjectSetup$ProjectSetupImpl.setUpProject(ProjectSetup.java:69)
at com.android.tools.idea.gradle.project.sync.ng.SyncResultHandler.setUpProject(SyncResultHandler.java:136)
at com.android.tools.idea.gradle.project.sync.ng.SyncResultHandler.onSyncFinished(SyncResultHandler.java:88)
at com.android.tools.idea.gradle.project.sync.ng.SyncResultHandler.lambda$onCompoundSyncModels$6(SyncResultHandler.java:268)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Howto analyse this, How to get a meaningfull message. Its very frustrating to be blind every upgrade of Androidstudio.
Is there a way to execute the sync by console / terminal ?
Update
I could restrict the case. I found out this happens only if I am adding a android library (module). I can't understand why thi happens.
Update 2
I found the solution for me. The upgrade process added the following into my gradle script, which caused the problem. After removing it worked:
compileOptions.encoding = 'ISO-8859-1'
productFlavors {
}
The question is still open. How can we analyse this kind of issue in a professional way. I had to compare files without knowing without any contextual path.
It was good for me.
Download some components:
I used this trick to fix the problem I had with my gradle. First get a good internet connection and go to your local disk C: \Users \YourUsername. You will see a .gradle file there. Delete it and run android studio again for it to download everything again.
Though not in Android Studio 3.4.1, but I got a very similar error message in a newer version (4.1.3), so I ended up here.
For me the problem was that Kotlin version that is used for Gradle differed from the IDE plugin version.
The message was:
Gradle sync failed: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue#3e2d155f
Current thread: Thread[ApplicationImpl pooled thread 6,4,Idea Thread Group] 219783907
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 255359391
Make sure that ext.kotlin_version in your buildscript is the same as the plugin version (File/Settings/Plugins in Android Studio 4.1.3).

Jhipster gradle build failde

When running jhipster from command line I get the following error, I am using jhipster latest version (v3.12.2) on windows machine. It seems there is an issue with gradle build.
gradlew.bat bootRun
:cleanResources
:bootBuildInfo
:bower
:nodeSetup SKIPPED
:gulpConstantDev
[15:59:03] Using gulpfile C:\dev\test\gulpfile.js
[15:59:03] Starting 'ngconstant:dev'...
[15:59:03] Finished 'ngconstant:dev' after 23 ms
:processResources
:compileJava
:classes
:findMainClass
:pathingJar
:bootRun
java.lang.NoClassDefFoundError: org/springframework/core/env/Environment
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.Environment
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" :bootRun FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 15.498 secs
Using Maven works.
Regards
Yes, there is a gradle issue in this version, which produces this error if gradle cache path contains spaces. I suggest you permanently remove gradle cache to a path without spaces: Set Gradle Cache Directory?
If you need a temporary quick fix, like me, you can patch this using a dirty approach to fix the JHipster classpath. Suppose your Windows user name is "Your Name". Then it will be a part of the path string and you will need to replace it with "yourna~1" (it is the 8-chars equivalent for Windows long name directories, i.e. first 6 chars of the directory name lowercase without spaces + "~1"). You can patch it in your build.gradle, line 55 and the issue is gone:
attributes 'Class-Path': configurations.runtime.files.collect {
it.toURL().toString().replaceFirst(/file:\/+/, '/').replace("Your Name", "yourna~1")
}.join(' ')

hudson*.groovy not found in jenkins

I am trying to configure jenkins job with groovy scripts, I donot know what I am doing wrong with the configuration that I could not execute even a simple groovy command like
println System.getenv("PATH")
it shows the following stack trace when the jenkins tries to build then following error is thrown
[workspace] $ groovy "C:\Program Files (x86)\Jenkins\jobs\{Project_Name}\workspace\hudson2392295018240496017.groovy"
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "groovy" (in directory "C:\Program Files (x86)\Jenkins\jobs\{Project_Name}\workspace"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:780)
at hudson.Launcher$ProcStarter.start(Launcher.java:360)
at hudson.Launcher$ProcStarter.join(Launcher.java:367)
at hudson.plugins.groovy.Groovy.perform(Groovy.java:110)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535)
at hudson.model.Run.execute(Run.java:1732)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:234)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 16 more
Build step 'Execute Groovy script' marked build as failure
Finished: FAILURE
I am using default groovy version in jenkins configuration and have installed the jenkins plugins for groovy.
I am new to both jenkins and groovy.
Thanks in advance.
You need to have an install of Groovy which your Jenkins can see - which is the default option
Alternatively, you can add one in the global config
which can then be used in the build step
Started by user anonymous
Building in workspace /Users/xxxxxx/.jenkins/jobs/gr/workspace
[workspace] $ groovy /Users/xxxxx/.jenkins/jobs/gr/workspace/hudson5419917819864291744.groovy
build
/Users/xxxxxx/perl5/perlbrew/bin:/Users/xxxxx/perl5/perlbrew/perls/perl-5.16.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Finished: SUCCESS

Resources