Questions tagged [gradle]
Gradle is a project build automation tool that uses a Groovy DSL. Gradle build scripts support Maven and Ivy repositories as well as plain file system for dependency management.
gradle
52,516
questions
1455
votes
24
answers
476k
views
What is Gradle in Android Studio?
Gradle is a bit confusing to me, and also for any new Android developer. Can anyone explain what Gradle in Android Studio is and what its purpose is? Why is it included in Android Studio?
1293
votes
12
answers
537k
views
What's the difference between implementation, api 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 ...
1080
votes
36
answers
791k
views
Android Studio: Add jar as library?
I'm trying to use the new Android Studio but I can't seem to get it working correctly.
I'm using the Gson library to serialize/deserialize JSON-objects. But the library somehow isn't included in the ...
1023
votes
26
answers
1.1m
views
How can I force Gradle to redownload dependencies?
How can I tell Gradle to redownload dependencies from repositories?
911
votes
47
answers
750k
views
Android Studio Error "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8"
I downloaded the newest Android Studio, and I wanted to run the Android Jetpack Compose Project, but when I ran it, I got the error:
> Failed to apply plugin 'com.android.internal.application'.
>...
862
votes
12
answers
632k
views
Gradle build without tests
I want to execute gradle build without executing the unit tests. I tried:
gradle -Dskip.tests build
That doesn't seem to do anything. Is there some other command I could use?
838
votes
16
answers
890k
views
Using Gradle to find dependency tree
Is it possible to use Gradle to produce a tree of what depends on what?
I have a project and would like to find out all the dependencies so I may be able to prune it a little with forward declarations ...
824
votes
22
answers
956k
views
How to add local .jar file dependency to build.gradle file?
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 {
...
807
votes
24
answers
560k
views
Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23
I've always programmed Android with Eclipse and decided to start migrating to Android Studio. I decided to use the same SDK I already had for Eclipse, then:
Started a new project
Set minimum SDK 4.0 (...
679
votes
18
answers
1.3m
views
How to clear gradle cache?
I'm trying to use Android Studio, and the first time I boot it up, it takes like 45 MINUTES to compile... If I don't quit the application, it is okay - each subsequent compilation/running the app will ...
676
votes
12
answers
572k
views
How to run only one unit test class using Gradle?
I am new to Gradle. I use Gradle 1.10 and Ubuntu 13.
I want to know if there's any command to execute only one unit test class, similar to testOnly in SBT.
659
votes
35
answers
775k
views
No matching client found for package name (Google Analytics) - multiple productFlavors & buildTypes
Context:
I'm trying to set up Google Analytics for my app. (having 4 custom buildTypes and more than a few productFlavors)
It works fine when I select the Build Variant which has the applicationId ...
629
votes
20
answers
213k
views
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 ...
627
votes
38
answers
539k
views
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/...
624
votes
15
answers
853k
views
You have not accepted the license agreements of the following SDK components [duplicate]
I downloaded the latest Android SDK tools version 24.4.1. I used the command line to install SDKs. I typed y when asked
Do you accept the license 'android-sdk-license-c81a61d9' [y/n]: y
after ...