Error: task 'wrapper' not found in project ':app'.
This error message indicates that the build.gradle file for the 'app' module in your project does not contain a task called 'wrapper'.
The 'wrapper' task is typically used to generate the Gradle wrapper files, which are necessary for executing Gradle builds without requiring a locally installed Gradle distribution.
To fix this error, you can add the 'wrapper' task definition to your build.gradle file:
buildscript {
repositories {
// Add the necessary repositories if not already present
}
dependencies {
// Add the necessary dependencies if not already present
}
}
task wrapper(type: Wrapper) {
gradleVersion = 'X.X.X' // Specify the desired Gradle version
}
Replace 'X.X.X' with the version of Gradle you want to use. Make sure to sync your project after making these changes.
Here's an example of a build.gradle file with the 'wrapper' task defined:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '6.7.1'
}