app: failed At 9/30/2021 2:47 PM with 1 error
Task 'wrapper' not found in project ':app'.
Task 'wrapper' not found in project ':app'
* Try:
Run gradle tasks to get a list of available tasks.
Run with --stacktrace option to get the stack
Solution
For Java
This is because your build.gradle file doesn’t have a wrapper task. Add this code to build.gradle:
task wrapper(type: Wrapper){
gradleVersion = '7.2'
}
You can replace 7.2 with the gradle version you want, then run gradle wrapper
task.
For Kotlin:
Here is the proper method to declare the wrapper task in your build.gradle.kts file:
tasks.register<Wrapper>("wrapper") {
gradleVersion = "5.6.4"
}
In this Kotlin DSL code, use the register function to create a new task of type Wrapper and configure its properties within the lambda block.
Please ensure to substitute '5.6.4' with the preferred version of Gradle that you intend to utilize for your project.
No comments:
Post a Comment