Questions tagged [gradlew]

gradlew is an executable file created by the gradle wrapper plugin, to replace the normal gradle executable for a project

While the normal Gradle executable comes with the installed version and therefor depends on that version, gradlew downloads the correct version of Gradle (specified in the Gradle build script) and thereby ensures that the build is independent of the installed Gradle version.

One obtains a gradlew executable by applying the Gradle wrapper plugin in the build script, specifying a Gradle version and executing

gradle wrapper

After that gradlew can be used whenever one normally would use Gradle.

Official Gradle website: https://gradle.org/

1210 questions
481
votes
19 answers

gradlew: Permission Denied

I am attempting to run gradlew from my command line, but am constantly facing the following error. Brendas-MacBook-Pro:appx_android brendalogy$ ./gradlew compileDebug --stacktrace -bash: ./gradlew: Permission denied I am already running this…
Brenda Nicole Tan
  • 5,164
  • 2
  • 17
  • 17
337
votes
2 answers

Difference between using gradlew and gradle

What is the difference between using gradlew and gradle or are they the same?
megalucio
  • 5,051
  • 2
  • 22
  • 26
287
votes
27 answers

Could not find or load main class org.gradle.wrapper.GradleWrapperMain

I cleaned the whole project by deleting local directories like ~/.gradle, ~/.m2 ~./android and ~/workspace/project/.gradle and chosing File -> Invalidate Caches / Restart... in Android Studio. Now execution of the command ./gradlew leads to the…
SePröbläm
  • 5,142
  • 6
  • 31
  • 45
252
votes
10 answers

How/When to generate Gradle wrapper files?

I am trying to understand how the Gradle Wrapper works. In many source repos, I see the following structure: projectRoot/ src/ build.gradle gradle.properties settings.gradle gradlew gradlew.bat gradle/ wrapper/ …
smeeb
  • 27,777
  • 57
  • 250
  • 447
226
votes
29 answers

Gradle: Could not determine java version from '11.0.2'

I ran the following comment: ./gradlew app:installDebug only to be met with the log: FAILURE: Build failed with an exception. * What went wrong: Could not determine java version from '11.0.2'. * Try: Run with --stacktrace option to get the stack…
lesley2958
  • 2,538
  • 4
  • 15
  • 15
200
votes
40 answers

Android- Error:Execution failed for task ':app:transformClassesWithDexForRelease'

The Problem is that i am able to run my app when i change to debug mode but it fails when i switch to release mode. Exception: **FAILURE: Build failed with an exception.** > Execution failed for task ':app:transformClassesWithDexForRelease'. >…
178
votes
10 answers

Android Studio: Plugin with id 'android-library' not found

I've been trying to get ActionBarSherlock to work and having some issue. One issue I've come across is the following message when trying to build it: Plugin with id 'android-library' not…
Michael
  • 4,010
  • 4
  • 28
  • 49
123
votes
11 answers

How to change the version of the 'default gradle wrapper' in IntelliJ IDEA?

I want to use Gradle 1.10 instead of 1.9. I cannot seem to find where to change this. If I put this: task wrapper(type: Wrapper) { gradleVersion = '1.10' } in my build.gradle and rebuild, it is built with Gradle 1.9 again (so nothing actually…
Bloke
  • 2,229
  • 3
  • 22
  • 27
122
votes
5 answers

Gradle error: Write access is allowed from event dispatch thread only in Android Studio

After updating Android Studio to version 2.2 (on Windows 10) and somehow next morning I received such error when gradle built on any project: Write access is allowed from event dispatch thread only Despite that gradlew -build command worked and…
Beloo
  • 9,723
  • 7
  • 40
  • 71
106
votes
10 answers

How to use gradle zip in local system without downloading when using gradle-wrapper

I'm trying to build a gradle project with gradle-wrapper (gradlew). When I build with ./gradlew build, it outputs text Downloading http://services.gradle.org/distributions/gradle-1.11-bin.zip And I already got gradle-1.11-bin.zip downloaded…
TheKojuEffect
  • 20,103
  • 19
  • 89
  • 125
104
votes
22 answers

Kotlin could not find the required JDK tools in the Java installation

When running ./gradlew clean build I get following message: > Task :compileKotlin FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileKotlin'. > Kotlin could not find the required JDK tools in the…
Krzysztof Piszko
  • 1,355
  • 3
  • 12
  • 17
92
votes
9 answers

Can you deploy to a device via Gradle from the command line

What the question says really - can you issue any commands directly to gradlew via the command line to build, package and deploy to a device?
Matt Whetton
  • 6,616
  • 5
  • 36
  • 57
81
votes
10 answers

Why are my Gradle builds dying with exit-code 137?

I've been trying to compile and test a large project to use Gradle. The test run fine until they die unexpectedly. I dug around and resources said that this is due to a memory issue. If I reduce the number of tests in the suite, it runs fine. I…
Mridang Agarwalla
  • 43,201
  • 71
  • 221
  • 382
80
votes
3 answers

Difference between clean, gradlew clean

What is the difference between the following statements when issued from a Android Studio Project's terminal : Android_Studio_Project_Path: ./gradlew clean Android_Studio_Project_Path: ./gradlew clean assembleDebug Android_Studio_Project_Path:…
prago
  • 5,225
  • 5
  • 25
  • 27
57
votes
6 answers

Error with gradlew: /usr/bin/env: bash: No such file or directory

After committing my project's gradlew file from my Windows machine to the remote repo using Git, invoking gradlew on my Linux server failed with this message: /usr/bin/env: bash: No such file or directory What happened?
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
1
2 3
80 81