Questions tagged [build.gradle]

The file build.gradle describes the default actions and tasks launched by 'gradle' command in the appropriate folder.

Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else.

Gradle combines the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build. Powered by a Groovy DSL and packed with innovation, Gradle provides a declarative way to describe all kinds of builds through sensible defaults. Gradle is quickly becoming the build system of choice for many open source projects, leading edge enterprises and legacy automation challenges.

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

7483 questions
1163
votes
10 answers

What's the difference between implementation and compile in Gradle?

After updating to Android Studio 3.0 and creating a new project, I noticed that in build.gradle there is a new way to add new dependencies instead of compile there is implementation and instead of testCompile there is testImplementation. Example: …
795
votes
54 answers

All com.android.support libraries must use the exact same version specification

After updating to android studio 2.3 I got this error message. I know it's just a hint as the app run normally but it's really strange. All com.android.support libraries must use the exact same version specification (mixing versions can lead to…
humazed
  • 66,202
  • 30
  • 86
  • 124
675
votes
17 answers

How to add local .jar file dependency to build.gradle file?

So I have tried to add my local .jar file dependency to my build.gradle file: apply plugin: 'java' sourceSets { main { java { srcDir 'src/model' } } } dependencies { runtime files('libs/mnist-tools.jar',…
Wang-Zhao-Liu Q
  • 12,331
  • 27
  • 70
  • 106
593
votes
20 answers

Can the Android layout folder contain subfolders?

Right now, I'm storing every XML layout file inside the 'res/layout' folder, so it is feasible and simple to manage small projects, but when there is a case of large and heavy projects, then there should be a hierarchy and sub-folders needed inside…
Paresh Mayani
  • 122,920
  • 69
  • 234
  • 290
466
votes
28 answers

Building and running app via Gradle and Android Studio is slower than via Eclipse

I have a multi-project (~10 modules) of which building takes about 20-30 seconds each time. When I press Run in Android Studio, I have to wait every time to rebuild the app, which is extremely slow. Is it possible to automate building process in…
froger_mcs
  • 13,632
  • 5
  • 21
  • 34
448
votes
24 answers

How to manually include external aar package using new Gradle Android Build System

I've been experimenting with the new android build system and I've run into a small issue. I've compiled my own aar package of ActionBarSherlock which I've called 'actionbarsherlock.aar'. What I'm trying to do is actually use this aar to build my…
Miguel Lavigne
  • 18,143
  • 8
  • 52
  • 46
441
votes
30 answers

More than one file was found with OS independent path 'META-INF/LICENSE'

When I build my app, I get the following error: Error: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. More than one file was found with OS independent path 'META-INF/LICENSE' This is my build.gradle file: apply…
Cyrus
  • 6,067
  • 6
  • 24
  • 46
343
votes
21 answers

How do I tell Gradle to use specific JDK version?

I can't figure out to get this working. Scenario: I have an application built with gradle The application uses JavaFX What I want Use a variable (defined per developer machine) which points to an installation of a JDK which will be used for…
bully
  • 3,756
  • 2
  • 19
  • 26
329
votes
12 answers

How can I use external JARs in an Android project?

I have created an Android project and added an external JAR (hessian-4.0.1.jar) to my project. I then added the JAR to the build path and checked it off in Order and Export. Order and Export is ignored it seems, and all classes from the external JAR…
Fredrik Olsson
242
votes
15 answers

Error:Conflict with dependency 'com.google.code.findbugs:jsr305'

I created a new project in Android Studio 2.2 Preview 1 with Android App and Backend module with Google Messaging. This is the app file: apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" …
239
votes
22 answers

Android Studio gradle takes too long to build

My Android Studio project used to build faster but now it takes a long time to build. Any ideas what could be causing the delays? I have tried https://stackoverflow.com/a/27171878/391401 but no effect. I haven't any Anti virus running which could…
AndroidDev
  • 4,071
  • 5
  • 28
  • 55
234
votes
35 answers

Android Material and appcompat Manifest merger failed

I have next grade dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0-rc01' implementation 'com.android.support.constraint:constraint-layout:1.1.2' …
225
votes
7 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
  • 22,487
  • 41
  • 197
  • 389
220
votes
5 answers

Install / upgrade gradle on Mac OS X

How do I install/upgrade gradle for Mac?
mllm
  • 15,275
  • 14
  • 44
  • 58
203
votes
32 answers

DELETE_FAILED_INTERNAL_ERROR Error while Installing APK

I am using Android Studio 2.2 Preview. I am facing the issue Failure: Install failed invalid apk Error: While installing apk, I have made changes in build.gradle but could not retrack it, please suggest me solution???
Ali Sher Kashif
  • 2,133
  • 2
  • 9
  • 13
1
2 3
99 100