Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix 'Error running gradle @ line 24'

Tags:

flutter

Running my first Flutter program, encountered this issue. Unable to resolve it by adding Google().

Error Message

*Error running Gradle: ProcessException: Process "C:\Users\hariharan\Desktop\helloflutter\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

*Where: Build file 'C:\Users\hariharan\Desktop\helloflutter\android\build.gradle' line: 24

*What went wrong: A problem occurred evaluating root project 'android'.

A problem occurred configuring project ':app'. Failed to find target with hash string 'android-28' in: C:\Users\hariharan\AppData\Local\Android\sdk

*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 15s Command: C:\Users\hariharan\Desktop\helloflutter\android\gradlew.bat app:properties

Please review your Gradle project setup in the android/ folder.

Running flutter doctor -v

[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17134.829], locale en-SG)
    • Flutter version 1.5.4-hotfix.2 at C:\flutter_windows_v1.5.4-hotfix.2-stable\flutter
    • Framework revision 7a4c33425d (8 weeks ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at C:\Users\hariharan\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0
    • ANDROID_HOME = C:\Users\hariharan\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[√] Android Studio (version 3.4)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin version 36.1.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] VS Code (version 1.35.1)
    • VS Code at C:\Users\hariharan\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.1.0

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

No issues found!
like image 793
hari Haran Avatar asked Dec 08 '25 10:12

hari Haran


1 Answers

From the error: Failed to find target with hash string 'android-28', it seems that it's unable to find build tools for version 28. If you're using Android Studio, you can go through Tools > SDK Manager > Android SDK and make sure that you've got your Android SDKs up-to-date.

like image 130
Omatt Avatar answered Dec 10 '25 04:12

Omatt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!