```FAILURE: Build failed with an exception. * Wha...
# community-support
j
Copy code
FAILURE: Build failed with an exception.	
* What went wrong:	
org.gradle.api.InvalidUserDataException: On plugin declaration 'kotlin' expected to find any of 'id' or 'version' but found unexpected keys 'android' and 'compose'.	
> On plugin declaration 'kotlin' expected to find any of 'id' or 'version' but found unexpected keys 'android' and 'compose'.	
* Try:	
> Run with --stacktrace option to get the stack trace.	
> Run with --info or --debug option to get more log output.	
> Get more help at <https://help.gradle.org>.	
BUILD FAILED in 4
From what I have in my libs.version.toml
Copy code
[plugins]
android.application = { id = "com.android.application", version.ref = "agp" }
kotlin.android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin.compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
Can someone explain my issue a little, please?
m
Use
-
instead of
.
Copy code
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
that error message could certainly be improved though
j
sweet, i had, that, don't know why I changed it, this will fix that?
m
It should get you further ^^
j
i was working wioth a partner, maybe they changed it
thak you very much for your help!
great community
❤️ 1
m
Sure thing
j
im not using it, but would that have been the same as _ ?
m
mmm, not exactly if I remember correctly,
-
will be turned into
.
when used in your
build.gradle.kts
files while
_
will basically stay the same
try it out!
j
ah, so using the - is like staging the call, then it gets built into .
☝️ 1
m
Yes, it's different in
.toml
and in
.gradle.kts
j
so much to learn!
m
It never stops!
j
that fixed that problem, now i have task issues in my build gradle kts file I must attend to this, but thank you, if I stumble again, I will certainly ask again in the community
👍 1
im gonna throw an @ in my app for you helping me, how do you want to be immortalized?
seriously though, I finally fixed it, and now its going back for review. when I get the chance ill put it in the app store under the description, gimma a name to put there for you
m
@mbonnin
works
👌 1
v
I'm not sure there can be too much done about the error message, it is a matter of the used TOML format.
Copy code
kotlin.android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin.compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
is semantically identical to
Copy code
kotlin = { android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }, compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } }
And there you might see better what
android
and
compose
it complains about. What you could do is:
Copy code
kotlin-android.id = "org.jetbrains.kotlin.android"
kotlin-android.version.ref = "kotlin"
kotlin-compose.id = "org.jetbrains.kotlin.plugin.compose"
kotlin-compose.version.ref = "kotlin"
or
Copy code
kotlin-android = { id = "org.jetbrains.kotlin.android", version = { ref = "kotlin" } }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version = { ref = "kotlin" } }