Vlastimil Brecka
02/04/2025, 4:36 PMFROM bellsoft/liberica-openjdk-alpine:17 AS build-environment
WORKDIR /product-app
# Cache gradlew
COPY gradlew build.gradle settings.gradle ./ <-----------------
COPY gradle gradle <-----------------
RUN ./gradlew tasks <-----------------
# Copy sources & build
COPY . .
RUN ./gradlew :app:bootJar
is this an idiomatic way to create `Dockerfile`s when building with ./gradlew
?
is there maybe something neater? or possible a single copy command?Balakrishna Dongrekar
02/05/2025, 4:54 AM(node:2592) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
info A dev server is already running for this project on port 8081.
info Installing the app...
> Task :app:mergeDebugResources FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to <https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings|https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings> in the Gradle documentation.
57 actionable tasks: 9 executed, 48 up-to-date
info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: <https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor|https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor>
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
> Resource compilation failed (Failed to compile values resource file C:\Users\balakrishnad\Desktop\Task\SpeechToText\android\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.nio.file.InvalidPathException: Illegal char <:> at index 43: com.speechtotext.app-mergeDebugResources-24:/values/values.xml). Check logs for more details.
* 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|https://help.gradle.org>.
BUILD FAILED in 8s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable > Resource compilation failed (Failed to compile values resource file C:\Users\balakrishnad\Desktop\Task\SpeechToText\android\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.nio.file.InvalidPathException: Illegal char <:> at index 43: com.speechtotext.app-mergeDebugResources-24:/values/values.xml). Check logs for more details. * 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|https://help.gradle.org>. BUILD FAILED in 8s.
info Run CLI with --verbose flag for more details.
Devraj Nivriti Sutar
02/05/2025, 5:05 AMA problem occurred configuring project 'gradle pluginreact-native-gradle-plugin'.> java.util.zip.ZipException: zip END header not found What should I do I am facing this error .
Sangam Subedi
02/05/2025, 2:53 PMGoodness Nzube
02/05/2025, 3:04 PMSreenivas
02/06/2025, 7:00 AMpublishing {
publications {
rootBOM(MavenPublication) {
from components.javaPlatform
artifactId = 'my-framework-root-bom'
}
}
Adam
02/06/2025, 1:44 PMincludeBuild("../core") {
name = "core"
dependencySubstitution {
substitute(module("se.vermiculus.veriprimer:veriprimer-platform-common"))
.using(project(":platform:common"))
substitute(module("se.vermiculus.veriprimer:veriprimer-testing-infrastructure-test-execution"))
.using(project(":testing:infrastructure:test-execution"))
substitute(module("se.vermiculus.veriprimer:veriprimer-testing-utilities-request-execution"))
.using(project(":testing:utilities:request-execution"))
}
}
It is not possible to not have to specify each module like this? With the plugins this was not needed.Niels Doucet
02/06/2025, 3:34 PMCaused by: java.lang.NullPointerException: group.displayName must not be null
at org.gradle.problems.internal.impl.DefaultProblemsReportCreatorKt$problemId$1$1.invoke(DefaultProblemsReportCreator.kt:104)
at org.gradle.problems.internal.impl.DefaultProblemsReportCreatorKt$problemId$1$1.invoke(DefaultProblemsReportCreator.kt:102)
...SNIP...
at org.gradle.internal.cc.impl.problems.JsonWriter.jsonObjectList(JsonWriter.kt:77)
at org.gradle.problems.internal.impl.DefaultProblemsReportCreatorKt$problemId$1.invoke(DefaultProblemsReportCreator.kt:102)
It looks like a property passed in by the report creator itself:
https://github.com/gradle/gradle/blob/master/platforms/ide/problems/src/main/kotli[…]g/gradle/problems/internal/impl/DefaultProblemsReportCreator.kt
Unfortunately I have no context clues about why this happens and it seems to be a local-only problem.
Has anyone seen this before?Giuseppe Barbieri
02/06/2025, 3:57 PMbuildSrc
with precompiled script plugins in Groovy.
May I add alongside a precompiled script plugin in Kotlin?
trying to add id 'org.gradle.kotlin.kotlin-dsl'
to the buildSrc/build.gradle
, but I do get:
> Plugin [id: 'org.gradle.kotlin.kotlin-dsl'] was not found in any of the following sources:Jesse Wilson
02/07/2025, 12:21 AMjava.lang.UnsupportedOperationException
at org.gradle.internal.locking.DefaultDependencyLockingProvider$LockingDependencySubstitution.artifactSelection(DefaultDependencyLockingProvider.java:277)
at org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DefaultDependencySubstitutions$CompositeBuildSubstitutionAction$1.artifactSelection(DefaultDependencySubstitutions.java:388)
at org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DefaultDependencySubstitutions$AbstractDependencySubstitutionAction.execute(DefaultDependencySubstitutions.java:403)
Thomas Chan
02/07/2025, 8:18 AMA
with composite build child projects X
and Y
.
A
, X
and Y
are all version controlled with git and has their own git repositories.
X
and Y
are git submodules for A
.
This set up makes development very easy and the structure is quite clean.
Trouble is, now we have to add a shared library S
which both X
and Y
depends on.
Is there an elegant way to do this while still using git submodules and gradle composite builds?Javi
02/07/2025, 10:41 AMSreenivas
02/07/2025, 11:38 AMMatei David
02/07/2025, 7:14 PMinterface MyLibraryExtension {
fun getValue(): String
...
}
I create such an object and register it as myLibrary
extension upon applying the plugin.
I want to test it with TestKit.
In a test project build.gradle.kts
:
• This works: println(myLibrary::class.java.getMethod("getValue").invoke(myLibrary))
• But this fails: println(myLibrary.getValue())
with "Unresolved reference: getValue".
So Gradle under TestKit:
• Finds the extension object just fine.
• It can inspect it and use it via reflection just fine.
• It cannot deal with the extension without reflection...?!
Am I missing something for this to work in TestKit?
It all works fine if I try it out on the CLI without TestKit.
Update: It even works if I use Groovy build.gradle
instead of Kotlin build.gradle.kts
in the test project...Sergej Koščejev
02/08/2025, 8:08 AMDirectory
and RegularFile
over File
in my API? The API that Gradle provides for working with Directory and RegularFile objects seems to be a bit lacking compared to plain Files.Sergej Koščejev
02/08/2025, 6:44 PMincludeBuild(".")
in the parent doesn't seem to work.Ziad Tarik
02/08/2025, 11:14 PMZiad Tarik
02/08/2025, 11:14 PMMuskan Verma
02/09/2025, 1:30 PMFAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Settings file 'D:\Muskan\React Native\GoogleMaps\android\settings.gradle' line: 2
* What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> A problem occurred configuring project ':gradle-plugin:react-native-gradle-plugin'.
> java.util.zip.ZipException: zip END header not found
* 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>.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Failed to query the value of property 'buildFlowServiceProperty'.
> Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@26ad70f4 of type BuildFlowService.Parameters
> A problem occurred configuring project ':gradle-plugin:react-native-gradle-plugin'.
> java.util.zip.ZipException: zip END header not found
* 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>.
==============================================================================
Segunfunmi Oyedele
02/10/2025, 5:03 AMSreenivas
02/10/2025, 12:43 PMAkash Verma
02/11/2025, 8:49 AMCould not resolve all dependencies for configuration 'classpath'.> The new Java toolchain feature cannot be used at the project level in combination with source and/or target compatibility" can any one help am not able to resolve this
Giuseppe Barbieri
02/11/2025, 11:19 AM~.gradle/wrapper/dists/gradle-8.12.1-all
I see an additional folder representing some hash 5akij8gnr65tdxupapyu22pqa
, which kind of hashing is that?Robert Elliot
02/11/2025, 11:46 AMnativeCompile
needs the jar file to include a META-INF/native-image/<project_name>/reachability-metadata.json
file, so nativeCompile
transitively depends on classes
• This can be generated with a test run using an agent - I've registered a new task of type Test
called agentTest
for this
• A test run obviously has to depend on classes
So I end up with:
nativeCompile
-> agentTest
(output build/generated/sources/main/resources/META-INF/native-image/<project_name>/reachability-metadata.json
) -> classes
But I need to run classes
again between nativeCompile
and agentTest
so that META-INF/native-image/<project_name>/reachability-metadata.json
is part of the jar file that nativeCompile
works on...
Perhaps I need a whole parallel flow of nativeJar
-> nativeClasses
that can know about the output of `agentTest`; but then I'm not sure how to make nativeCompile
use the output of my nativeJar
rather than the jar
task it presumably knows about.Bradley Campbell
02/11/2025, 1:52 PMMatthew Inger
02/11/2025, 2:42 PMabstract class StringGeneratorSegment @Inject constructor(
project: Project,
objects: ObjectFactory
) {
abstract val name: String
val inputDirectory =
objects.directoryProperty().convention(project.layout.projectDirectory.dir("src/${name}"))
val outputDirectory =
objects.directoryProperty().convention(project.layout.buildDirectory.dir("strings/${name}"))
override fun toString(): String {
return "StringGeneratorSegment(name=${name}, inputDirectory=${inputDirectory.get()}, outputDirectory=${outputDirectory.get()}"
}
}
val segments: NamedDomainObjectContainer<StringGeneratorSegment> =
project.container(StringGeneratorSegment::class)
I'd like to use the "name" property in the convention for the input and output directories, but those seem to be "null" when the convention is set. Is there any good way to do something like this?Giuseppe Barbieri
02/12/2025, 4:42 PM./gradlew build
it keeps downloading the distro again, the structure seems to be fine
$ cd ${GRADLE_USER_HOME}
$ find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
.
|-gradle.properties
|-init.d
| |-elara.nexus.init.gradle.kts
|-wrapper
| |-dists
| | |-gradle-8.12.1-bin
| | | |-eumc4uhoysa37zql93vfjkxy0
| | | | |-gradle-8.12.1
| | | | | |-init.d
| | | | | | |-readme.txt
| | | | | |-bin
| | | | | | |-gradle.bat
| | | | | | |-gradle
| | | | | |-NOTICE
| | | | | |-LICENSE
| | | | | |-lib
| | | | | | |-native-platform-osx-aarch64-0.22-milestone-27.jar
| | | | | | |-gradle-base-services-groovy-8.12.1.jar
| | | | | | |-gradle-base-asm-8.12.1.jar
I also see in the logs ./gradlew
deletes the right directory
$ ./gradlew build
Downloading <https://services.gradle.org/distributions/gradle-8.12.1-bin.zip>
.............10%.............20%.............30%.............40%.............50%.............60%.............70%.............80%.............90%.............100%
Deleting directory /home/user/.gradle/wrapper/dists/gradle-8.12.1-bin/eumc4uhoysa37zql93vfjkxy0/gradle-8.12.1
any idea why?Никита Гучаков
02/13/2025, 6:36 AMElham Hajialigholikivi
02/13/2025, 10:23 AMArthur McGibbon
02/13/2025, 1:35 PMgradlew clean classes
from 2 CLIs simultaneously then 1 of them will fail with missing classes issues because the other has just wiped its compilation result. I don't actually do this but I have run a CLI command at the same time as Intellij is running a build and that has caused a failure. Is there any kind of locking based on project location?