George Rabbat
George Rabbat

Reputation: 578

Could not find builder.jar (com.android.tools.build:builder:3.5.3)

I'm stuck. when I've added google_maps_flutter to my project. since then, when I try to run the App throws me this exception:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...

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 find builder.jar (com.android.tools.build:builder:3.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.5.3/builder-3.5.3.jar
   > Could not find protos.jar (com.android.tools.analytics-library:protos:26.5.3).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/analytics-library/protos/26.5.3/protos-26.5.3.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 1s
Finished with error: Gradle task assembleDebug failed with exit code 1

I've tried to delete Gradle and download a 5.6.2 version but no luck. and tried with a VPN and nothing changed.

I've deleted google_maps_flutter from my dependencies list and library but still doesn't work. what possibly is the issue here? my Android Studio version is 3.5.3

pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  flutter_swiper: ^1.1.6
  sliding_up_panel: ^1.0.0
  cupertino_icons: ^0.1.2
#  flutter_mapbox_navigation: ^0.0.10
#  google_maps_flutter: ^0.5.25+3
dev_dependencies:
  flutter_test:
    sdk: flutter 

build.gradle:

buildscript {
    repositories {
        google()
        mavenCentral()
        jcenter()
    }

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

Upvotes: 1

Views: 912

Answers (2)

George Rabbat
George Rabbat

Reputation: 578

I solved the problem by deleting the .gradle folder located in C:\Users\{Your User}\.gradle and re-sync it.

if you're living in a country under sanctions. Try using a VPN to re-sync it.

Upvotes: 2

M.Zohrabi.lml_
M.Zohrabi.lml_

Reputation: 91

your problem is the gradle can't download and sync dependencies if your country is under us sanctions. refer this answer https://stackoverflow.com/a/61035661/7909288 may help.

Upvotes: 0

Related Questions