Closed theGeekyLad closed 11 months ago
libs is the gradle version catalog generated by gradle. What version of Android Studio are you using and how are you trying to build the samples? I can't reproduce any issues, the project seems to build fine.
i get Build file '.../compose-samples/JetNews/app/build.gradle.kts' line: 17
Error resolving plugin [id: 'com.android.application', version: '8.0.2']
The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
Make sure that gradle 8.1 is downloaded and file named "libs.versions.toml" exists under module level gradle folder of JetNews project
I set android gradle plugin version 8.0.2 gradle version 8.1
still getting an error like this
org.gradle.api.GradleException: Error resolving plugin [id: 'com.android.application', version: '8.0.2']
So this is how I fixed the issue,
libs.versions.toml change androidGradlePlugin, android-application like this. [versions] androidGradlePlugin = "8.0.2" [plugins] android-application = { id = "com.android.application", version = "8.0.2" }
At Project build.gradle.kts, add these lines in plugins {}
plugins { alias(libs.plugins.gradle.versions) alias(libs.plugins.version.catalog.update) // these lines.. alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kapt) apply false alias(libs.plugins.hilt) apply false alias(libs.plugins.secrets) apply false alias(libs.plugins.android.application) apply false alias(libs.plugins.android.test) apply false }
and it started to work.
This issue has been automatically marked as stale because it has not had any recent activity. Please comment here if it is still valid so that we can reprioritize it. Thank you for your contributions.
a simpler way to solve it for me was:
libs.versions.toml
file over to your projectbuild.gradle.kts
(project level) over to your project or just copy the libs you need to add
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
Is this an issue related to one of the samples?
Sample app
Other (bug not related to sample app)
What happened?
I get the
Unresolved reference: libs
error while trying to perform a Gradle build. Looks like a bunch oflibs. ...
are used within thebuild.gradle.kts
file but I don't see the definition of theselibs
variables.Any thoughts?
Relevant logcat output
No response
Code of Conduct