in my root `build.gradle` I have `apply from: 'tes...
# gradle
a
in my root
build.gradle
I have
apply from: 'test.gradle.kts'
, then in
test.gradle.kts
I have:
Copy code
tasks.register("vytibnhcyfugohsjfdbnafvdsa") {

}
After I run Sync Project with Gradle files twice, I get this warning in Android Studio (see image), and the log says
Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$DuplicateTaskException: Cannot add task 'vytibnhcyfugohsjfdbnafvdsa' as a task with that name already exists.
Am I doing something wrong, or is this is a bug?
f
Maybe you are adding this file twice?
a
certainly not
also:
./gradlew tasks
doesn't give any more information, it prints the task name as expected among other tasks
m
You could
println(…)
something before creating the task. Probably and for whatever reason the script is executed twice 😮
🔝 1
a
I added
println("vyuogihj")
before
tasks.register
, then I got:
Copy code
$ ./gradlew tasks | grep vyuogihj              
vyuogihj
also, when I sync with gradle in Android Studio, this is the output
f
Maybe the best option is to register the tasks only if it doesn't exist. I'm not a gradle expert, but I think the integration between Android Studio and kotlin gradle files are experimental