How to solve - "Gradle Project Sync" error in Android Studio?
Hi, Akash this side!
First, let me introduce myself. I am a Computer Science and Engineering student. In this Lockdown period, I decided to learn Android Development. But with time, I used to get errors in Android Studio.
Yesterday, when I was learning about multiple screen apps and I decided to import an app’s code from Github, I got a “Gradle Sync” error when I imported the code.
So, I had wasted my 4–5 hours solving it. I searched about it on the so-called engineer’s weapon StackOverFlow but couldn’t able to solve it by the methods given there.
So, let's talk about “How to solve Gradle Project Sync Error in Android Studio”.
Now, you should follow these steps :
1 - Go to your search engine and type “Gradle download”. Click one the first result appears on the window. And download the latest version of Gradle (Note - It will be in Zip format).
After clicking on
“Installation - Gradle” you will see this -
Now, click on download then you will able to see this -
This is the latest version of the Gradle so download it (It is in Zip format) and save it in the location where your Android studio is installed (If while installing Android studio you choose default options then it will be in C: partition).
2 - Now you have to extract the folder and delete the zip file.
3 - Open your Android Studio and any file in it.
4 - Now, click on the top-most left option named “file”.
Now follow these steps :
Settings -> Build, execution and deployment -> Build Tools -> Gradle
5 - Now you will see this window -
Now we have set these two options and then our Gradle is ready for the magic.
6 - In the first option “Gradle User Home” we have to set the path of the Gradle file which we have downloaded earlier.
Here you can see the second rectangle contains my Gradle file and the first rectangle contains its path. So, we have to copy this in our first option “Gradle User Home”.
7 - In the second option you first select the specific path and then paste the same link as before.
8 - Now click on the “OK and Apply” option and restart your android studio.
Now your android studio is ready to serve you and go do some with it to make the world more beautiful.
Happy Coding :)
If you like this answer please upvote and share it with your friends.
No comments:
Post a Comment