My project has an interesting issue with Gradle. When running "gradle build" from inside Intellij 13 (windows or linux), I get the following error message:
10:05:48 PM: Executing external task 'build'...
:processResources UP-TO-DATE
:compileAspect FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileAspect'.
> Error creating temporary file
* 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: 7.434 secs
Access is denied
10:05:56 PM: External task execution finished 'build'.
From here, I ran a full debug located here: Pastebin
Which shows it failing in the AjcTask.java file at the below line:
1993 tmpFile = File.createTempFile("argfile", "", userDir);
Might be related to GRADLE-1400 which is for and older version but unresolved. On linux, if I cd to the project directory, I can run "gradle build" without trouble after that first time, then I can run it from Intellij as well without an issue.
Maybe the environment vars getting nuke somehow?
It looks like GRADLE-2532.
user.dir property defaults to C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.1\jre\jre\bin in your case which causes Access Denied error.
In IDEA 13.1.2 and previous versions enabling Use customizable gradle wrapper option should help. This will set user.dir to the project root directory.
In IDEA 13.1.3 and later versions there are different workarounds available, check this comment.
Related
I am trying to understand gradle.
I followed the gradle tutorial here: https://docs.gradle.org/current/samples/sample_building_java_applications.html#what_youll_build
In short:
I created a folder: mkdir demo
cd demo
gradle init (so far so good)
Now, I tried to run my application like this: gradlew run.
The first run of the application was successful. However, the subsequent runs kept failing and I got a very non descript error.
> Task :app:run FAILED
Error: Could not find or load main class demo.App
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:run'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_211\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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
2 actionable tasks: 1 executed, 1 up-to-date
Then, I deleted the files inside "Z:\Projects\demo\ .gradle\6.7.1\executionHistory" and I was able to run the application again.
This was happening again and again. Please see attached screenshot:
What am I doing wrong -- how do I fix this so that all calls to 'gradlew run' give me a successful build?
Edit:
I tried it on C: and was able to do 'gradlew run' consistently and get
the 'Hello World' output without any issues. My Z drive is actually an
encrypted VeraCrypt file which has been loaded with letter 'Z'. Not
sure if that is causing problems.
Thanks!
Hello I was facing the issue too, spend a lot of time and now I am sure, that the issue is the file system. I believe that your encrypted partition is using exFAT. Gradle is not able to process this file system properly.
Could Someone help me this problem?
I got this error when I use Ionic & cordova, trying to build the andorid app.
I have tried few way to solve this problem, like:
reinstall the Java JDK 8
edit the computer env variable path (JAVA_HOME, PATH...etc)
But none of these work :(
I current use:
Ionic#1.2.4
cordova#8.0.0
Windows 10
Node.js#11.6.0
npm#6.5.0-next.0
jdk 1.8.0_271
Windows PowerShell Photo
⚡ lienlab#CCU_LAB ~ Desktop client HybridApp_Zyxel ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\lienlab\Desktop\client\HybridApp_Zyxel\hooks\after_prepare\010_add_platform_class.js C:\Users\lienlab\Desktop\client\HybridApp_Zyxel
add to body class: platform-android
will push strings array {"name":"lang","titles":["English (US)","English (UK)"],"values":["en-us","en-gb"]}
android preferences file was successfully generated
ANDROID_HOME=C:\Users\lienlab\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_271
Subproject Path: CordovaLib
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_93e2b48xftftse4tgevu6kz4n.run(C:\Users\lienlab\Desktop\client\HybridApp_Zyxel\platforms\android\build.gradle:138)
BUILD FAILED
Total time: 5.006 secs
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> The SDK directory 'C:\Users\User\AppData\Local\Android\sdk' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
(node:14808) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> The SDK directory 'C:\Users\User\AppData\Local\Android\sdk' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at ChildProcess.whenDone (C:\Users\lienlab\Desktop\client\HybridApp_Zyxel\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:188:13)
at maybeClose (internal/child_process.js:978:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
(node:14808) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14808) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
In one of my projects I get a gradle error message whenever I try to run code in debug mode (^D):
...
> Task :apps:travel-information-service:testClasses UP-TO-DATE
> Task :apps:travel-information-service:test FAILED
FAILURE: Build failed with an exception.
* Where:
Initialization script '/private/var/folders/lx/lnqmbcy557ndwxld1hbsjlf00000gn/T/ijresolvers.gradle' line: 347
* What went wrong:
Execution failed for task ':apps:travel-information-service:test'.
> System property 'idea.debugger.dispatch.port' is not set
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
Searching for this issue did not give any results.
It does not matter which code I try to debug (Java applications, junit tests, etc all give the same error). Running the code normally (non-debug mode) works fine. My other projects are fine using the same version of Intellij. I have tried rebooting, invalidating the caches in Intellij, reimporting the gradle project, and even completely removing the .idea directory.
Any tips on how to investigate (or even fix ;-)) this issue are greatly appreciated!
I'm using Gradle build tool and I can't get the source code and docs for spark-core.
I've already searched and applied:
idea {
project {
jdkName = '1.8'
languageLevel = '1.8'
}
module {
downloadJavadoc = true
downloadSources = true
}
}
But it still doesn't work for me. I suppose I'm missing something like rebuild the whole project or download just these pieces.
I applied ./gradlew cleanIdea idea as well.
When I try to click with pressed command on SparkConf.class I press Download Sources I get Sources not found for: org.apache.spark:spark-core_2.12:2.4.5
And the result from the run tab:
21:11:29: Executing task 'DownloadSources'...
:DownloadSources FAILED
BUILD FAILED
Total time: 0.124 secs
FAILURE: Build failed with an exception.
* Where:
Initialization script '/private/var/folders/06/97bzw1l51r59l65thfzs7hd80000gn/T/ijmiscinit1.gradle' line: 14
* What went wrong:
Execution failed for task ':DownloadSources'.
> Could not resolve all dependencies for configuration ':downloadSourcesFrom_MavenRepo_91653a2f-0439-4794-b77a-3812f9926728'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
21:11:29: Task execution finished 'DownloadSources'.
Here is 2 pretty long task outputs:
DownloadSources --info: https://pastebin.com/D07JmGXT
DownloadSources --stacktrace: https://pastebin.com/6ceKhwrk
Idea.log https://pastebin.com/EQcDxPwb
Latest public Intellij build: 2020.1.1 installed via Toolbox
Latest MacOS: 10.15.4
Java 1.8 jdk-8u251-macosx-x64.dmg, downloaded from oracle.com
Could you please help me to realize what should I do to fix it?
The problem belongs to Scala plugin.
If you face this issue, it doesn't matter on build tool you are using Maven or Gradle probably installation of the Scala plugin solves your problem.
My Intellij report: https://intellij-support.jetbrains.com/hc/en-us/requests/2686145
Well-known bug: https://youtrack.jetbrains.com/issue/IDEA-127193
Using libGDX, and TomGrill's gdx-testing's tests subproject, and trying to run with gradle (gradlew tests:test) the default example from the examples directory and I get this error.
Testing started at 14:47 ...
14:47:05: Executing task 'test'...
Executing tasks: [test]
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
14:47:06: Task execution finished 'test'.
If I try to run it with IntelliJ's run-tests button
I get the error
Process finished with exit code 1
Class not found: "de.tomgrill.gdxtesting.examples.AssetExistsExampleTest"Empty test suite.
And last, if I try to run only one test from said suite I get the same error.
What am I doing wrong?
Turns out the error was with Gradle versions. I updated to the newest version of Android Gradle Google provides, and used a newer local Gradle as that was needed, and for some reason, this doesn't work. Made a new empty project and left the original Gradle versions, and the tests ran. There might be a better way to fix this, however, I'm going to go with this.