Questions tagged [gradle-plugin]
Gradle is a project build automation tool. A Gradle plugin packages up reusable pieces of build logic, which can be used across many different projects and builds. Gradle allows you to implement your own custom plugins, so you can reuse your build logic, and share it with others.
gradle-plugin
1,617
questions
1293
votes
12
answers
536k
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 ...
416
votes
7
answers
144k
views
What the difference in applying gradle plugin
I don't understand gradle plugins block
apply plugin: 'someplugin1'
apply plugin: 'maven'
and other one:
plugins {
id 'org.hidetake.ssh' version '1.1.2'
}
In first block We have some plugin ...
241
votes
35
answers
400k
views
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....
132
votes
13
answers
89k
views
org.gradle.api.InvalidUserCodeException: Querying the mapped value of provider (java.util.Set) before task ... has completed is not supported
I upgraded my project to Android Studio Arctic Fox, so I have to upgrade gradle to 7.0.2 and gradle build tool to 7.0.0-beta04.
After synchronizing, I got this warning message in Sync tab:
org.gradle....
125
votes
8
answers
203k
views
cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected
I am facing this issue many times when i download project from github
i am using new Android studio(bumble bee)
please help me if any body knows
https://github.com/fjbatresv/arcore_solar_system.git (...
113
votes
41
answers
218k
views
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
I am getting this kind of error, how to fix it.
Error:Unable to load class 'org.gradle.tooling.internal.protocol.test.InternalTestExecutionConnection'.
Possible causes for this unexpected error ...
89
votes
8
answers
80k
views
How do I create an executable fat JAR with Gradle with implementation dependencies?
I've got a simple project in Gradle 4.6 and would like to make an executable JAR of it. I've tried shadow, gradle-fatjar-plugin, gradle-one-jar, spring-boot-gradle-plugin plugins but neither of them ...
85
votes
7
answers
72k
views
Not able to copy configurations dependencies after upgrading Gradle plugin for Android Studio to 3.0.1 and Gradle to 4.1
I used to copy 'compile' dependencies to a specific folder using this simple gradle task :
task copyLibs(type: Copy) {
from configurations.compile
into "$project.rootDir/reports/libs/"
}
But ...
81
votes
14
answers
168k
views
Update Gradle in Flutter project
I have this project in Flutter, but I haven't been able to build an apk for a couple of weeks, because of the Gradle version. I've tried everything, but Flutter always returns the error below:
I ...
80
votes
8
answers
71k
views
Gradle version 1.10 is required. Current version is 2.0
I am trying to use latest Gradle version (2.0), however I keep getting this message when hitting gradle build in terminal. Why is it asking for 1.10 version? I am new to Gradle, so I'm trying to get ...
62
votes
4
answers
64k
views
How can the gradle plugin repository be changed?
I work at a big company with a strict policy forbidding the unfiltered use of outside libraries. We have to pull everything from blessed corporate repositories, and not the bare internet, including ...
59
votes
15
answers
190k
views
How to fix "plugin was not found in any of the following sources"
I created a Spring MVC project ion Intellij IDEA. When I build my project, following message is displayed, how can I resolve it?
Plugin [id: 'org.springframework.boot', version: '2.1.7.RELEASE'] was ...
46
votes
2
answers
36k
views
Difference apply from vs apply plugin
Is there a difference except that:
apply from: - gets the (plugin).gradle from a URL
apply plugin: - gets the (plugin).gradle from the gradle plugin server
42
votes
12
answers
42k
views
Android-studio 3.4.0-3.4.2 Gradle ERROR: No value has been specified for property 'manifestOutputDirectory'
when upgrading to android-studio 3.4.x/gradle build plugin 3.4.x /gradle 5.3 ... wondering if its an issue with the android plugin.
ERROR: No value has been specified for property '...
40
votes
13
answers
69k
views
build failing during merge resources with Android Gradle plugin 3.3.0
I have a lot of different flavors for my build that have specific resources and I don't want to clutter my src directory in my project with a bunch of flavor-specific directories, so I add the source ...
40
votes
6
answers
23k
views
configuration-cache enabled causes build to fail
I've just upgraded our project to use gradles build and configuration caches to help build speeds. But when running this command the build fails
gradlew dependencies --stacktrace --scan
I have this ...
38
votes
4
answers
17k
views
difference between android gradle plugin and gradle
Android Studio 3.2 Canary 5
Build #AI-173.4630681, built on March 3, 2018
JRE: 1.8.0_152-release-1136-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.4-300.fc27.x86_64
I have ...
38
votes
2
answers
16k
views
Gradle7 Version Catalog: How to use it with buildSrc?
I am very excited about the incubating Gradle's version catalogs and have been experimenting with it. I’ve found that the information in my gradle/libs.versions.toml is accessible in the build.gradle....
31
votes
20
answers
95k
views
Gradle threw an error while downloading artifacts from the network .. Exception: Gradle task assembleDebug failed with exit code 1
I just started with app development with flutter, but am not even able to run the test app. This is what come on console :
Launching lib/main.dart on AOSP on IA Emulator in debug mode... Running ...
30
votes
2
answers
14k
views
How do I know the properties in applicationVariants of android gradle plugin?
I'm using Android Studio with gradle plugin to develop applications. I learn some usage of android gradle plugin on DSL Reference. But one thing I found is that the applicationVariants part on doc is ...
30
votes
2
answers
9k
views
Android multi module test dependency
With Android Studio 3.0 / android_gradle_version = '3.0.1' / gradle-4.5
Let's say I have two android modules
module-base
module-a
When I want to access sources from module-base in module-a , I just ...
27
votes
4
answers
16k
views
Android Studio 3.1 : Could not find org.jetbrains.trove4j:trove4j:20160824
Yesterday, I updated Android Studio to 3.1 and I'm getting this error :
Could not find org.jetbrains.trove4j:trove4j:20160824.
Searched in the following locations:
https://repo.maven.apache.org/...
27
votes
4
answers
48k
views
Cannot get property 'compileSdkVersion' on extra properties extension as it does not exist Open File
I imported a project downloaded from GitHub into my Android Studio project as module.
The "Import module..." wizard worked fine, but when the Adroid Studio tried to rebuild the project, it returned me ...
26
votes
5
answers
14k
views
Upgrading Gradle from 7.4.2 to Gradle 8.0.0 gives error on release app - java.lang.ClassCastException
I have recently upgraded Android Studio to Flamingo and also upgraded Gradle from 7.4.2 to 8.0.0. All things working fine in version 7.4.2.
When I generate a signed APK using Gradle 8.0.0, it's giving ...
25
votes
2
answers
17k
views
Gradle > How to stop a Spring Boot application launched with gradle bootRun?
I started a spring boot application using gradle bootRun.
Doing ctrl-c in the terminal where I launched the command does not stop the application.
What is then the correct way of stopping it?
24
votes
2
answers
25k
views
List Gradle dependencies for all subprojects
I can query the dependency tree for a Gradle project with ./gradlew -q dependencies.
I can also run the query for the service subproject with ./gradlew service:dependencies.
How can I list the ...
22
votes
2
answers
11k
views
Kotlin Test Coverage
Does anyone know if a good test coverage tool (preferably Gradle plugin) exists for Kotlin? I've looked into JaCoCo a bit, but it doesn't seem to reliably support Kotlin.
21
votes
1
answer
11k
views
Gradle sync failed: 'com.android.build.gradle.BasePlugin' does not implement the Plugin interface
Environment : Android Studio 2.1
Project : Android SDK + Cordova
Android Studio throws the following error during Gradle Sync :
Gradle sync failed: 'com.android.build.gradle.BasePlugin' does not ...
20
votes
5
answers
43k
views
Spring Boot plugin requires Gradle 4.10 or later. The current version is Gradle 4.1
I have a Spring Gradle project. I'm trying to make a build using gradle build command. But getting below error :
* Where:
Build file 'F:\MyProjectName\build.gradle' line: 2
* What went wrong:
An ...
19
votes
11
answers
43k
views
Original kapt is deprecated
I have changed Kotlin version to 1.2.30. After the update I unable to run the project. I got the below error message.
Error:Execution failed for task ':app:compileDevDebugJavaWithJavac'.
> app: ...
19
votes
5
answers
10k
views
Android/Gradle: conditionally apply plugin based on build type
I would like to make something like (pseudo code):
if (BuildType == "release"){
apply plugin: 'testfairy'
} else if (BuildType == "debug"){
apply plugin: 'io.fabric'
}
The idea is that based ...
19
votes
3
answers
7k
views
Android plugin is too old (2.4.0-alpha7)
I'm using android studio 2.4, And getting this error. Apparently I have to update my android plugin, but when I checked jcenter for new versions the only version
available was 2.5.0-alpha-preview-02. ...
19
votes
1
answer
4k
views
Disable Google Services Gradle plugin for specific flavour
The usage of Google Services requires the use of this Gradle plugin:
apply plugin: 'com.google.gms.google-services'
This thread on the Gradle forum has lead me to conclude that you can't selectively ...
17
votes
5
answers
22k
views
Android Studio plugin is too old
I was syncing fine and then suddenly when I tried to run a test on a device from Android Studio I started getting the error:
Error:(1, 0) Plugin is too old, please update to a more recent version, ...
17
votes
6
answers
6k
views
Can i disable Firebase plugin for specific flavor?
I'm currently trying out the Firebase analytics suit, but, i have faced one small issue, my app is distributed on both google play and amazon store (which doesn't support google play services), so for ...
16
votes
11
answers
58k
views
Some file crunching failed, see logs for details
Today I got update for android studio 2.0 in stable version.
I update it and it restarted.
Then when It opens my existing project, it ask me to update my gradle plugin to 2.0 to get advantages of "...
16
votes
5
answers
51k
views
Gradle Enterprise Gradle plugin (com.gradle.enterprise) not found error in jenkins when trying to build my project
Iam using the Gradle 6.5 version installed on my linux server.I have configured Gradle in jenkins which resides on the same server.
I have set a Freestyle project job on jenkins to build using gradle....
16
votes
3
answers
26k
views
How to fix 'Could not write standard input to Gradle Test Executor 1' error in Java
I'm trying to compline my code(on new branch) but I got the error after I fix and updated build.gradle but before I run that code my code(on old branches) is still working.
So I checkout master ...
15
votes
2
answers
20k
views
How to update Gradle plugin in Android Studio
Inside Android Studio I'm getting the error:
Generating signed Bundle requires you
to update the Android Gradle plugin
to version 3.2.0 or higher
If I click "Close this dialog and update the plugin" ...
15
votes
1
answer
4k
views
Create custom Build init type - for Gradle Build Init Plugin?
I'm fairly new to gradle and I would like to create a custom type for with the Gradle Init Plugin. Moreover, I'd like to be able to do something like:
gradle init --type jsp-library
This would ...
14
votes
2
answers
7k
views
Checkstyles + Gradle throwing Caused by: java.lang.IllegalArgumentException: given name COMPACT_CTOR_DEF
I've recently added the checkstyle plugin to the project for static code analysis. But after updating the google-style.xml from the latest master, I've started receiving the below exception :
org....
14
votes
1
answer
18k
views
WARNING: API 'variant.getMergeAssets()' is obsolete / Android Studio 3.3
After the recent android update, each time I build my app, I receive the following warnings:
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant....
14
votes
2
answers
17k
views
Gradle Spring Boot Devtools: developmentOnly and runtimeClasspath
I am puzzled by this block of code to be used in a gradle file, suggested by Spring Boot Documentation on Developer Tools
configurations {
developmentOnly
runtimeClasspath {
...
13
votes
6
answers
7k
views
While Android Studio Updated to v3.3 getting API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'
Getting this Warning (Even when variant.getAssemble() is not used anywhere):
API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
I have updated ...
13
votes
1
answer
8k
views
How to setup a Gradle plugin project in IntelliJ?
I want to create a standalone Gradle plugin project as described in the Gradle documentation. I would like to use IntelliJ with code completion for Groovy and Gradle. Since there is no specialized ...
13
votes
2
answers
2k
views
How to test afterEvaluate when writing Gradle plugin
I am writing a custom Gradle plugin. I am writing tests for every feature that I want to create in the plugin.
I am using java to write the plugin.
I create my tasks in the apply method inherited ...
13
votes
2
answers
8k
views
Kotlin Multiplatform : Plugin [id: 'com.android.library'] was not found
I am trying to set up Android Library via Kotlin Multiplatform Library.
I am getting error:
Plugin [id: 'com.android.library'] was not found in any of the following sources:
Please help me by ...
13
votes
3
answers
2k
views
Define buildConfigField for androidTest
I'm defining a particular field in the BuildConfig for getting the URL during runtime. So, for each build type, I use a different string:
prod {
buildConfigField "String", "BASE_URL", "\"...
12
votes
3
answers
15k
views
No signature of method: com.crashlytics.tools.gradle.CrashlyticsPlugin On Mac [closed]
Below error while gradle sync Failed in Mac.
CONFIGURE FAILED in 3s
ERROR: No signature of method: com.crashlytics.tools.gradle.CrashlyticsPlugin.findObfuscationTransformTask() is applicable for ...
12
votes
5
answers
5k
views
plugin-under-test-metadata.properties not created by Gradle TestKit when running tests in IDEA
I am using Gradle 3.3 and trying to test a custom plugin with JUnit and Gradle TestKit. In plugin's build.gradle I have
version '0.1'
apply plugin: 'groovy'
apply plugin: 'java-gradle-plugin'
...