Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not resolve com.android.tools.build:gradle:3.2.1. flutter

I am getting this error when I want to run my flutter app. I am using flutter 1.0.0 version and android studio 3.2.1 version.

My emulator is Pixel 2 android 8.1.

I have also used android 9 but it did not work either.

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "E:\TUT\flutter\project\myfirstapp\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.2.1.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.2.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
               > jcenter.bintray.com
      > Could not resolve com.android.tools.build:gradle:3.2.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
               > dl.google.com

* 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 27s
  Command: E:\TUT\flutter\project\myfirstapp\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.
like image 479
geek man Avatar asked Jan 31 '26 23:01

geek man


2 Answers

you need to add repository google() to the buildscript dependencies of the root project.

the file might be E:\TUT\flutter\project\myfirstapp\android\build.gradle

right next to the jcenter() repository; which does not serve this dependency.

like image 189
Martin Zeitler Avatar answered Feb 03 '26 14:02

Martin Zeitler


I was getting the same error until I ran it with internet connection,seemingly it downloaded necessary resources.

like image 29
Ombori Avatar answered Feb 03 '26 14:02

Ombori



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!