0

I Got this error after installing Android Studio

A problem occurred configuring root project 'afsar'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find bundletool-1.11.0.jar (com.android.tools.build:bundletool:1.11.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/1.11.0/bundletool-1.11.0.jar

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

I added these lines to gradle but not work:

maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
jcenter()

Finally I downloaded bundletool-1.11.0.jar file but I don't know where to paste it. please help!

Answer: I selected the latest version of gradle for my app and my problem was solved!!!

gradle-version: 8.0-rc-2
Android-gradle-plugin-version: 7.4.0-beta04
Reza
  • 47
  • 2
  • 12

1 Answers1

1

First, you shouldn't HAVE to download dependencies manually. Usually, when Gradle can't find an existing artifact from a well-known repo, it's just a sign that you have some network issue going on (i.e., proxies, firewall, other network security). If you can point a web-browser to https://www.gradle.org, you should be able to have Gradle do the downloading for you if you sort out the real problem.

Some things that might help are replacing jcenter() (now non-existent--see here: "JCenter is at end of life" android lint warning, what is the replacement? ) with something like mavenCentral(), and perhaps the maven.google.com with its shortcut, google().

Then, check your proxy settings in gradle.properties (perhaps with the answers here: Gradle proxy configuration ).

But, if you do have an artifact in hand, and you just want to use it, you can use the flatDir inside of repositories { ... }, such as described here:

flatDir uses a path specified as a "repository". Together, it might look like:

repositories {
  google(); mavenCentral()
  maven { url 'https://maven.fabric.io/public' }
  flatDir {
    dirs "${projectDir}/libs"
  }
}

This will look in multiple existing repositories, as well as search the folder libs/ in your project for the local copy of the .jar.

User51
  • 887
  • 8
  • 17