Hi. I have a colleague who cannot build an android...
# gradle
j
Hi. I have a colleague who cannot build an android kotlin project using precompiled scripts in a separate build project. He is the only one out of a group of 5 with this problem. I tried a cmd line only
./gradlew assemble
to eliminate Android Studio as the problem and he still has the issue. Details in thread. Any help would be appreciated. Thanks in advance ! 🙏
Error:
Copy code
android-app-conventions.gradle.kts: (15, 1): Expression 'android' cannot be invoked as a function. The function 'invoke()' is not found
Shell JVM: openjdk11 Gradle Version: (gradle wrapper) gradle-7.5-all
I have destroyed his gradle caches,
~/.gradle/caches
, ensured he is using java11, and performed a clean build and fresh git checkout
a
that’s really weird. Are they on Windows, while everyone else is on Mac/Linux?
j
no all on mac
a
is
android-app-conventions.gradle.kts
a pre-compiled script plugin? (Is it in buildSrc, or an included-build?) It is applied using
apply(from = "...")
?
j
pre-compiled in an included-build
applied using plugins block
Copy code
plugins {
id("android-app-conventions")
}
the included build depends on android gradle plugin and only applies the kotlin-dsl to its project
a
and the error still happens on the command line when he runs
./gradlew assemble
? (I didn’t understand your original message, whether it was specificially related to Android Studio)
j
yes, it happens on command line. i ruled out Android studio as a culprit
a
what happens if they run this?
Copy code
./gradlew clean assemble --rerun-tasks --no-build-cache --no-configuration-cache --no-parallel
(I think I spelled all of that right…)
j
i will ask and get back to you
we'll see if you did 😉
a
aside from that you could try updating to Gradle 7.6.1 - maybe a bug was fixed, or a new version might clear out some dirty cache
j
ok thanks. I was going to ask if you had any other recommendations since he just jumped offline.
thanks for your help
a
no problem! Let us know if something works