0
votes

when i building my flutter project i have the following error Launching lib/main.dart on Mi A2 in debug mode...

  • Error running Gradle:

    Exit code 1 from: /home/khaled/flutter/oky/android/gradlew app:properties: Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error. FAILURE: Build failed with an exception.

    • Where: Build file '/home/khaled/flutter/oky/android/app/build.gradle' line: 25
    • What went wrong:

gradle file :

buildscript {
repositories {
    google()
    jcenter()

}

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
}


}

 allprojects {
repositories {
    google()
    jcenter()
}
}

  rootProject.buildDir = '../build'
  subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
  }
   subprojects {
project.evaluationDependsOn(':app')
   }

  task clean(type: Delete) {
delete rootProject.buildDir
 }
1
paste the error after - What went wrong:anmol.majhail
i would suggest you to remove task clean(type: Delete) { delete rootProject.buildDir } then runanmol.majhail
Did you manage to find a solution? I also have this error!wagnerdelima
@wagnerdelima i find the solutionKhaled sb
Where is the solution @Khaledsb?wagnerdelima

1 Answers

1
votes

I found this solution: It's still not in master branch but it's in beta. Master is the least stable version so far. Just do this in terminal:

flutter channel
flutter channel master
flutter upgrade

and it should work