I"ve mounted Android studio 3.0.1 and also tried to build very very first app with picking an north activity, yet I"ve obtain the message:

Gradle project sync failed. Basic functionality (e.g. Editing, debugging) will certainly not work-related properly

and error blog post like this:

Unable to settle dependency because that ":app

*

*

and this is very first part the log message is:

I"ve do the efforts some said solution like changing gradle version, update Kotlin plugin(!) and so, yet they didn"t work.

You are watching: Gradle project sync failed. basic functionality will not work properly

Any solution?


Answers


34
The problem caused by my connection. I needed to set proxy come download part components.


Sunday, august 8, 2021
*

answer 3 Months earlier
Boris
10

Foreword

That error article is not enough information to diagnose the problem. There are means to obtain more information, and also that have to be inspected first.

The Gradle output itself should point at the really error in the couple of lines above that message in between :module:someTask FAILED and the critical :module:someOtherTask. Therefore, if girlfriend ask a question around your error, please edit your concerns to include much more context to the error.

The problem

The someTask part of the app:someTask failure is very essential as it tells you exactly which step of the build procedure has crashed.

These steps include preparing dependencies, generating and merging the legacy and resource files, check the code for errors and compiling, then ultimately installing the app.

If in ~ any allude of the build procedure Gradle detects one anomaly, it will throw a non-zero exit value describe an error has occurred.

The leave value chin is somewhat important.

1 is a just a basic error code and also the error is likely in the Gradle output2 seems to be related to overlapping dependencies or job misconfiguration.3 appears to be from including too countless dependencies, or a memory issue.

There are probably others, so please feel free to provide your own comments or answer with other values.

The solution

The basic solutions because that the over (after attempting a Clean and also Rebuild that the project) are:

1 - address the error the is mentioned. Generally, this is a compile-time error, meaning some piece of password in your job is not valid. This has both XML and Java for an Android project. Refer to the picture for all the points going into the app

*

2 & 3 - countless answers below tell you to allow multidex. When it may fix the problem, that is most likely a workaround. If you don"t know why you space using the (see the link), you most likely don"t require it.

If you space unable to find any error output in the Gradle log, climate the recommended food of activity would be to open up Gradle home window of Android Studio.

*

Open increase the jobs folder because that each module and also perform some mix of the following.

To clean and also reset the code of generated files, use develop > clean complied with by build > build. To examine nested dependencies, use help > dependencies. Make certain none space duplicated. To inspect your password for syntax errors and also warnings, run confirmation > lint. This will certainly output one HTML document that you deserve to read in her browser. The Gradle logs will certainly say created HTML report to file:///path/to/app/build/outputs/lint-results.html, so just open that paper to check out all the errors and also warnings. To shot and run the application on a device, usage install > installDebug.

Additional notes

I"ve checked out many short article with worth 2 when just installing Android Studio and there is one error

"android-studio/jre/bin/java" finished through non-zero departure value 2

Installing the Java JDK and also correctly configuring Android Studio to use the JDK seems to resolve this issue.

See more: What Kind Of Guy Will Fall For You ? What Type Of Guy Will You Fall For

If you are using the Google beat Services by translate in "com.google.android.gms:play-services:X.Y.Z", then only incorporate the dependencies you in reality need, otherwise girlfriend most most likely did hit the Multidex limit. See exactly how to allow it.

If you have a heat in her Gradle paper that reads translate in fileTree(dir: "libs", include: <"*.jar">), then you don"t need any kind of other heat that has actually compile files("libs/some_file.jar") because that an initial way claims "include every JAR record in the libs/ directory."

Along with that point, if you space using Gradle and are may be to uncover the dependencies the you would like to usage by browsing the Maven Repository, climate it is strongly urged to usage that rather of manually placing JAR documents into the libs/ directory. For each library on that site, over there is a Gradle tab and also you just need to copy the one line and also put compile right into the dependencies section.

If you have actually a line the compiles an additional project such together compile project(":project_name"), then make certain you aren"t duplicating dependencies native there.

Another systems for memory-related problems involves broadening the heap size, which is excellent from the build.gradle prefer so

android // various other stuffs dexOptions javaMaxHeapSize "2g" // or "4g" if your device has sufficient memory