1
  • I am using Flutter 0.9.4 • channel beta
  • Android Studio 3.2.1
  • VS Code 1.28.2

Whenever I try to debug and run my app it shows following error msg:

enter image description here

Launching lib\main.dart on Custom Phone, 8 0, API 26, 768x1280 in debug mode...
* Error running Gradle:
Exit code 1 from: C:\Users\Ketan\Documents\Flutter\hello\android\gradlew.bat 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 'C:\Users\Ketan\Documents\Flutter\hello\android\app\build.gradle' line: 25

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

* 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 2s
Please review your Gradle project setup in the android/ folder.
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Ketan Ramteke
  • 10,183
  • 2
  • 21
  • 41

1 Answers1

0

Try this from flutter documentation:

Update your path

If you wish to run Flutter commands in the regular Windows command prompt, take these steps to add Flutter to the PATH environment variable:

  • Go to

“Control Panel > User Accounts > User Accounts > Change my environment variables”

  • Under “User variables” check if there is an entry called “Path”:

  • If the entry does exist, append the full path to flutter\bin using ; as a separator from existing values.

  • If the entry does not exist, create a new user variable named Path with the full path to flutter\bin as its value. Reboot Windows to fully apply this change.

Nicolas Mandica
  • 803
  • 1
  • 10
  • 16
Suliman Farzat
  • 1,197
  • 11
  • 12
  • 4
    I already have path set up, it was the small bug with flutter.gradle which is located in flutter\packages\flutter_tools\gradle . After editing it VS code is working fine. Thank you. – Ketan Ramteke Nov 04 '18 at 01:04
  • 1
    @KetanRamteke You can add it as an accepted answer so that it would be helpful in future for others( like me :P) :) – Mayur Mar 05 '19 at 07:46