Sunny Ngwenya
09/07/2024, 6:54 AMSunny Ngwenya
09/07/2024, 6:56 AMCould not find method implementation() for arguments [org.jetbrains.kotlinkotlin stdlib2.0.20] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.* 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.BUILD FAILED in 1m 33s Error: Gradle task assembleDebug failed with exit code 1
Sunny Ngwenya
09/07/2024, 6:56 AMAdam
09/07/2024, 7:42 AMAdam
09/07/2024, 7:43 AMVampire
09/07/2024, 2:17 PMimplementation configuration, but you do not have any plugin applied that adds such a configuration like the Kotlin plugin, the Java plugin, one of the Android plugins, and so on.
As the error says it is happening on the root project called android, and the typical setup you would copy from a book like your path suggests is to have an empty root project and a sub project called app where you have your actual code, you would have applied the relevant plugins in the sub project and thus also need to add the dependency there.
Besides that, I highly recommend to use Kotlin DSL instead of Groovy DSL. By now it is the default DSL, you immediately get type-safe build scripts, actual helpful error messages when mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.
Also, be very critic on anything you read in a book about Gradle, especially if it has a certain age. Gradle is still evolving relatively quickly and things that were good practice or state of the art some time ago, are now discouraged bad practices. Hence you often find stale or bad advice online or in older books.